Annotation of embedaddon/php/tests/lang/engine_assignExecutionOrder_004.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Evaluation order during assignments.
                      3: --FILE--
                      4: <?php
                      5: 
                      6: function i1() {
                      7:         echo "i1\n";
                      8:         return 1;
                      9: }
                     10: 
                     11: function i2() {
                     12:         echo "i2\n";
                     13:         return 1;
                     14: }
                     15: 
                     16: function i3() {
                     17:         echo "i3\n";
                     18:         return 3;
                     19: }
                     20: 
                     21: function i4() {
                     22:         global $a;
                     23:         $a = array(10, 11, 12, 13, 14);
                     24:         echo "i4\n";
                     25:         return 4;
                     26: }
                     27: 
                     28: $a = 0; // $a should not be indexable till the i4 has been executed
                     29: list($a[i1()+i2()], , list($a[i3()], $a[i4()]), $a[]) = array (0, 1, array(30, 40), 3, 4);
                     30: 
                     31: var_dump($a);
                     32: 
                     33: ?>
                     34: --EXPECT--
                     35: i1
                     36: i2
                     37: i3
                     38: i4
                     39: array(6) {
                     40:   [0]=>
                     41:   int(10)
                     42:   [1]=>
                     43:   int(11)
                     44:   [2]=>
                     45:   int(0)
                     46:   [3]=>
                     47:   int(30)
                     48:   [4]=>
                     49:   int(40)
                     50:   [5]=>
                     51:   int(3)
                     52: }

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