Annotation of embedaddon/php/tests/lang/bug21600.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Bug #21600 (assign by reference function call changes variable contents)
        !             3: --INI--
        !             4: error_reporting=4095
        !             5: --FILE--
        !             6: <?php
        !             7: $tmp = array();
        !             8: $tmp['foo'] = "test";
        !             9: $tmp['foo'] = &bar($tmp['foo']);
        !            10: var_dump($tmp);
        !            11: 
        !            12: unset($tmp);
        !            13: 
        !            14: $tmp = array();
        !            15: $tmp['foo'] = "test";
        !            16: $tmp['foo'] = &fubar($tmp['foo']);
        !            17: var_dump($tmp);
        !            18: 
        !            19: function bar($text){
        !            20:   return $text;
        !            21: }
        !            22: 
        !            23: function fubar($text){
        !            24:   $text = &$text;
        !            25:   return $text;
        !            26: }
        !            27: ?>
        !            28: --EXPECTF--
        !            29: Strict Standards: Only variables should be assigned by reference in %sbug21600.php on line 4
        !            30: array(1) {
        !            31:   ["foo"]=>
        !            32:   string(4) "test"
        !            33: }
        !            34: 
        !            35: Strict Standards: Only variables should be assigned by reference in %sbug21600.php on line 11
        !            36: array(1) {
        !            37:   ["foo"]=>
        !            38:   string(4) "test"
        !            39: }

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