|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-12-30 06:39 UTC] helly@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 08:00:01 2025 UTC |
Description: ------------ well, when i try to use unserialize in a class on the object itself, that's return me an empty object, all property are set to NULL. the code below work well with php4, but doesn't with php5. Reproduce code: --------------- <?php class a { var $x; function unS($serial) { $this = unserialize($serial); } } $test1 = new a; $test1 -> x = 'blabla'; var_dump($test1); $serial = serialize ($test1); var_dump($serial); $test2 = new a; $test2->unS($serial); //$test2 = unserialize($serial); var_dump($test2); ?> Expected result: ---------------- i expected the same behaviour as in php4. php5 return me the right result when i use unserialize out of the class but return me an empty object when i use it in the class. actual result ------------------------- object(a)#2 (1) { ["x"]=> NULL } expected result ------------------------- object(a)#2 (1) { ["x"]=> string(7) "blabla" }