Bug #73207 [Opn->Ver]: Array ordering is same between 5.6.21 and 7.1.0 RC3

From: Date: Fri, 30 Sep 2016 09:57:50 +0000
Subject: Bug #73207 [Opn->Ver]: Array ordering is same between 5.6.21 and 7.1.0 RC3
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204365@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73207&edit=1 ID: 73207 Updated by: cmb@php.net Reported by: tuyen-truong at cybozu dot vn Summary: Array ordering is same between 5.6.21 and 7.1.0 RC3 -Status: Open +Status: Verified Type: Bug Package: Arrays related PHP Version: 7.1.0RC3 Block user comment: N Private report: N New Comment: Indeed, the behavior changed again as of PHP 7.1.0beta1, see <https://3v4l.org/BPNL3>. Not sure if that is a bug or rather a documentation issue. Previous Comments: ------------------------------------------------------------------------ [2016-09-30 09:33:38] yohgaki@php.net Behavior changed between 7.1.0 alpha3 and 7.1.0 beta1. https://3v4l.org/TiMHY ------------------------------------------------------------------------ [2016-09-30 08:40:29] tuyen-truong at cybozu dot vn Description: ------------ As description at http://php.net/manual/en/migration70.incompatible.php The "Array ordering when elements are automatically created during by reference assignments has changed" is written. And there is no other description about array ordering in http://php.net/manual/en/migration71.incompatible.php But, when I have confirmed the result, I saw that the output of php5.6.21 and php7.1.0RC3 are same. I think that it is bug of PHP7.1.0RC3, but please confirm it is a bug or not. Thank you. Test script: --------------- 1. php56.exe -r "$array = []; $array['a'] =& $array['b']; $array['b'] = 1; var_dump($array);" Output: array(2) { ["b"]=> &int(1) ["a"]=> &int(1) } 2. // php7.0.6 php70.exe -r "$array = []; $array['a'] =& $array['b']; $array['b'] = 1; var_dump($array);" Output: array(2) { ["a"]=> &int(1) ["b"]=> &int(1) } 3. php71.exe -r "$array = []; $array['a'] =& $array['b']; $array['b'] = 1; var_dump($array);" Output: array(2) { ["b"]=> &int(1) ["a"]=> &int(1) } Expected result: ---------------- When executing this script 3. php71.exe -r "$array = []; $array['a'] =& $array['b']; $array['b'] = 1; var_dump($array);" The output will be same the output of php7.0.6 array(2) { ["a"]=> &int(1) ["b"]=> &int(1) } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73207&edit=1

« previous php.bugs (#204365) next »