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

1.1       misho       1: --TEST--
                      2: Closure 019: Calling lambda using $GLOBALS and global $var
                      3: --FILE--
                      4: <?php
                      5: 
                      6: $lambda = function &(&$x) {
                      7:        return $x = $x * $x;
                      8: };
                      9: 
                     10: function test() {
                     11:        global $lambda;
                     12:        
                     13:        $y = 3;
                     14:        var_dump($GLOBALS['lambda']($y));
                     15:        var_dump($lambda($y));
                     16:        var_dump($GLOBALS['lambda'](1));
                     17: }
                     18: 
                     19: test();
                     20: 
                     21: ?>
                     22: --EXPECTF--
                     23: int(9)
                     24: int(81)
                     25: 
                     26: Fatal error: Cannot pass parameter 1 by reference in %s on line %d

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