From: Operating system: at least on Windows PHP version: Irrelevant Package: Unknown/Other Function Bug Type: Bug Bug description:Type casting problem
Description: ------------ Hi there! I am having a standard class using numeric keys as properties which works fine in general. The numeric keys are currently Strings. After serializing and unserializing the class, the properties will be converted to Integers which makes them unaccessible. Have a look at the code example below. Regards Lukas Test script: --------------- <?php $a = new stdClass(); $a->{0} = 'X'; $a->{1} = 'Y'; var_dump($a); echo "\n0:", $a->{0}, "\n1:", $a->{1}, "\n\n"; $b = unserialize(serialize($a)); var_dump($b); echo "\n0:", $b->{0}, "\n1:", $b->{1}, "\n\n"; ?> Expected result: ---------------- object(stdClass)#2 (2) { ["0"]=> string(1) "X" ["1"]=> string(1) "Y" } Actual result: -------------- object(stdClass)#2 (2) { [0]=> string(1) "X" [1]=> string(1) "Y" } -- Edit bug report at https://bugs.php.net/bug.php?id=55798&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55798&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55798&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55798&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=55798&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55798&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=55798&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=55798&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=55798&r=needscript Try newer version: https://bugs.php.net/fix.php?id=55798&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=55798&r=support Expected behavior: https://bugs.php.net/fix.php?id=55798&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=55798&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=55798&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=55798&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55798&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=55798&r=dst IIS Stability: https://bugs.php.net/fix.php?id=55798&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=55798&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=55798&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=55798&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=55798&r=mysqlcfg