Annotation of embedaddon/php/ext/standard/tests/general_functions/closures_002.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: register_tick_function() & closure
! 3: --FILE--
! 4: <?php
! 5:
! 6: declare (ticks = 1);
! 7:
! 8: $i = 0;
! 9: register_tick_function(function () use (&$i) { $i++; });
! 10:
! 11: echo "Test\n";
! 12: echo "$i\n";
! 13: echo "$i\n";
! 14: var_dump ($i != 0);
! 15: echo "$i\n";
! 16: echo "Done\n";
! 17:
! 18: ?>
! 19: --EXPECTF--
! 20: Test
! 21: %d
! 22: %d
! 23: bool(true)
! 24: %d
! 25: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>