On Friday 27 June 2008, Dmitry Stogov wrote: > 1) Fixed ref/noref issues
Works for me. See attached test 11. Gesundheit Wag -- For sale: baby shoes, never worn. - flash fiction by Hemingway
--TEST-- Closure test: Closure calls itself --SKIPIF-- <?php if (!class_exists('Closure')) die('skip Closure support is needed'); ?> --FILE-- <?php $i = 3; $lambda = function ($lambda) use (&$i) { if ($i==0) return; echo $i--."\n"; $lambda($lambda); }; $lambda($lambda); echo "$i\n"; ?> --EXPECT-- 3 2 1 0
--TEST-- Closure test: Lexical copies not static in closure --SKIPIF-- <?php if (!class_exists('Closure')) die('skip Closure support is needed'); ?> --FILE-- <?php $i = 1; $lambda = function () use ($i) { return ++$i; }; $lambda(); echo $lambda()."\n"; //early prototypes gave 3 here because $i was static in $lambda ?> --EXPECT-- 2
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php