|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-07-03 11:53 UTC] jani@php.net
[2008-07-03 11:55 UTC] taco at procurios dot nl
[2008-07-04 08:16 UTC] jani@php.net
[2008-07-04 08:43 UTC] taco at procurios dot nl
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 21 18:00:01 2025 UTC |
Description: ------------ When serializing and later on deserializing the $GLOBALS array, global objects aren't recreated. Reproduce code: --------------- class Foo { public $foo; public function __construct($foo) { $this->foo = $foo; } } $Foo = new Foo(34); var_dump($GLOBALS['Foo']); $s = serialize($GLOBALS); $GLOBALS = unserialize($s); var_dump($GLOBALS['Foo']); Expected result: ---------------- object(Foo)#1 (1) { ["foo"]=> int(34) } object(Foo)#1 (1) { ["foo"]=> int(34) } Actual result: -------------- object(Foo)#1 (1) { ["foo"]=> int(34) } int(1)