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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: laruence@php.net
New email:
PHP Version: OS:

 

 [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: Tue Dec 03 20:01:30 2024 UTC