php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55325 array constant key cause un-order result
Submitted: 2011-07-30 15:33 UTC Modified: 2011-07-30 15:53 UTC
From: laruence@php.net Assigned:
Status: Duplicate Package: Scripting Engine problem
PHP Version: 5.3SVN-2011-07-30 (SVN) OS: Linux
Private report: No CVE-ID: None
 [2011-07-30 15:33 UTC] laruence@php.net
Description:
------------
this is similar to #50816

but not quite same. 



Test script:
---------------
define("FIRST_KEY", "a");
define("THIRD_KEY", "c");

function test()
{
        static $arr = array(
                "a" => "222",
                FIRST_KEY => "111",
                "c" => "333",
                THIRD_KEY => "444",
        );
        print_r($arr);
}

test();

Expected result:
----------------
Array
(
    [a] => 111
    [c] => 444
)

Actual result:
--------------
Array
(
    [a] => 222
    [c] => 444
)

Patches

bug55325.patch (last revision 2011-07-30 15:34 UTC by laruence@php.net)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-30 15:34 UTC] laruence@php.net
The following patch has been added/updated:

Patch Name: bug55325.patch
Revision:   1312040074
URL:        https://bugs.php.net/patch-display.php?bug=55325&patch=bug55325.patch&revision=1312040074
 [2011-07-30 15:53 UTC] laruence@php.net
-Status: Open +Status: Duplicate
 [2011-07-30 15:53 UTC] laruence@php.net
hmm, actually it's a dup...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC