Annotation of embedaddon/php/Zend/tests/closure_002.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Closure 002: Lambda with lexical variables (global scope)
! 3: --FILE--
! 4: <?php
! 5:
! 6: $x = 4;
! 7:
! 8: $lambda1 = function () use ($x) {
! 9: echo "$x\n";
! 10: };
! 11:
! 12: $lambda2 = function () use (&$x) {
! 13: echo "$x\n";
! 14: };
! 15:
! 16: $lambda1();
! 17: $lambda2();
! 18: $x++;
! 19: $lambda1();
! 20: $lambda2();
! 21:
! 22: echo "Done\n";
! 23: ?>
! 24: --EXPECT--
! 25: 4
! 26: 4
! 27: 4
! 28: 5
! 29: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>