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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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: Thu Dec 26 16:01:31 2024 UTC