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

1.1       misho       1: --TEST--
                      2: Closure 012: Undefined lexical variables
                      3: --FILE--
                      4: <?php
                      5: $lambda = function () use ($i) {
                      6:     return ++$i;
                      7: };
                      8: $lambda();
                      9: $lambda();
                     10: var_dump($i);
                     11: $lambda = function () use (&$i) {
                     12:     return ++$i;
                     13: };
                     14: $lambda();
                     15: $lambda();
                     16: var_dump($i);
                     17: ?>
                     18: --EXPECTF--
                     19: Notice: Undefined variable: i in %sclosure_012.php on line 2
                     20: 
                     21: Notice: Undefined variable: i in %sclosure_012.php on line 7
                     22: NULL
                     23: int(2)
                     24: 

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