Bug #61110 [Opn->Nab]: The same codes output the different results between ver5.3.8 & ver5.3.10
| From: | aharvey@php.net | Date: | Fri, 17 Feb 2012 00:53:13 +0000 |
| Subject: | Bug #61110 [Opn->Nab]: The same codes output the different results between ver5.3.8 & ver5.3.10 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-167585@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=61110&edit=1
ID: 61110
Updated by: aharvey@php.net
Reported by: tansuanna at gmail dot com
Summary: The same codes output the different results between
ver5.3.8 & ver5.3.10
-Status: Open
+Status: Not a bug
Type: Bug
-Package: Output Control
+Package: Class/Object related
Operating System: CentOS 5.5
PHP Version: 5.3.10
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[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