Edit report at https://bugs.php.net/bug.php?id=61110&edit=1
ID: 61110 Comment by: tansuanna at gmail dot com Reported by: tansuanna at gmail dot com Summary: The same codes output the different results between ver5.3.8 & ver5.3.10 Status: Not a bug Type: Bug Package: Class/Object related Operating System: CentOS 5.5 PHP Version: 5.3.10 Block user comment: N Private report: N New Comment: but i cant get the values: var_dump(isset($a[2])); // false var_dump(isset($a['2'])); // false $id = strval(2); var_dump(isset($a[$id])); // false Previous Comments: ------------------------------------------------------------------------ [2012-02-17 00:53:13] ahar...@php.net This came about as a result of the fix for bug #55798 in 5.3.9. At some point, we've just got to pick a behaviour and stick with it: the new behaviour at least makes the unserialised properties accessible, which is better than the old. ------------------------------------------------------------------------ [2012-02-16 17:58:49] tansuanna at gmail dot com Description: ------------ The same codes output the different results between ver5.3.8 & ver5.3.10: <?php $a = serialize((object)array( â1â² => âaaaâ, â2â² => âbbbâ, â3â² => âcccâ, )); $a = (array)unserialize($a); $a[1] = âdddâ; var_dump($a); ?> // results before ver5.3.8ï¼ array(3) { [1]=> string(3) âdddâ [2]=> string(3) âbbbâ [3]=> string(3) âcccâ } // results in ver5.3.10ï¼ array(4) { ["1"]=> string(3) âaaaâ ["2"]=> string(3) âbbbâ ["3"]=> string(3) âcccâ [1]=> string(3) âdddâ } Test script: --------------- <?php $a = serialize((object)array( â1â² => âaaaâ, â2â² => âbbbâ, â3â² => âcccâ, )); $a = (array)unserialize($a); $a[1] = âdddâ; var_dump($a); ?> Expected result: ---------------- output same results in their versions: array(3) { [1]=> string(3) âdddâ [2]=> string(3) âbbbâ [3]=> string(3) âcccâ } Actual result: -------------- // results before ver5.3.8ï¼ array(3) { [1]=> string(3) âdddâ [2]=> string(3) âbbbâ [3]=> string(3) âcccâ } // results in ver5.3.10ï¼ array(4) { ["1"]=> string(3) âaaaâ ["2"]=> string(3) âbbbâ ["3"]=> string(3) âcccâ [1]=> string(3) âdddâ } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=61110&edit=1