Annotation of embedaddon/php/Zend/tests/bug28072.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Bug #28072 (static array with some constant keys will be incorrectly ordered)
                      3: --FILE--
                      4: <?php
                      5: define("FIRST_KEY", "a");
                      6: define("THIRD_KEY", "c");
                      7:                                                                         
                      8:                  
                      9: function test()
                     10: {
                     11:         static $arr = array(
                     12:                 FIRST_KEY => "111",
                     13:                 "b" => "222",
                     14:                 THIRD_KEY => "333",
                     15:                 "d" => "444"
                     16:         );
                     17:         print_r($arr);
                     18: }
                     19:                                                                         
                     20: function test2()
                     21: {
                     22:         static $arr = array(
                     23:                 FIRST_KEY => "111",
                     24:                 "a" => "222",
                     25:                 "c" => "333",
                     26:                 THIRD_KEY => "444"
                     27:         );
                     28:         print_r($arr);
                     29: }
                     30:                  
                     31: test();
                     32: test2();
                     33: ?>
                     34: --EXPECT--
                     35: Array
                     36: (
                     37:     [a] => 111
                     38:     [b] => 222
                     39:     [c] => 333
                     40:     [d] => 444
                     41: )
                     42: Array
                     43: (
                     44:     [a] => 222
                     45:     [c] => 444
                     46: )

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>