Bug #70144 [Opn->Ver]: Assigning value to uninitialized byref array keys changed array order with PHP 7

From: Date: Mon, 27 Jul 2015 01:05:44 +0000
Subject: Bug #70144 [Opn->Ver]: Assigning value to uninitialized byref array keys changed array order with PHP 7
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-194734@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70144&edit=1 ID: 70144 Updated by: requinix@php.net Reported by: admin at angosso dot net -Summary: src_server +Summary: Assigning value to uninitialized byref array keys changed array order with PHP 7 -Status: Open +Status: Verified Type: Bug -Package: Built-in web server +Package: Scripting Engine problem Operating System: Linux, Windows, Mac -PHP Version: 5.6.11 +PHP Version: 7.0.0 Block user comment: N Private report: N New Comment: http://3v4l.org/cmaYm Previous Comments: ------------------------------------------------------------------------ [2015-07-27 00:23:43] admin at angosso dot net Description: ------------ The Elements of the code or object properties will be created automatically for the server [dot] in reference and assignment for bug. Test script: --------------- $array = []; $array["a"] =& $array["b"]; $array["b"] = 1; var_dump($array); now results in the array ["a" => 1, "b" => 1], while previously the result was ["b" => 1, "a" => 1]; Expected result: ---------------- /rfc/uniform_variable_syntax /rfc/abstract_syntax_tree Stack trace: #0 file.php(4): foo(42) #1 {main} ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=70144&edit=1

« previous php.bugs (#194734) next »