- changed status to resolved
Loop won't keep, if not reference in object EvWatcher
Issue #22
invalid
Its work (reference $w)
$i = 0; $w = new EvTimer(0, 1.0, function() use(&$i) { $i++; echo "$i\r\n"; }); Ev::run();
Its not work (not reference $w)
$i = 0; new EvTimer(0, 1.0, function() use(&$i) { $i++; echo "$i\r\n"; }); Ev::run();
Comments (3)
-
repo owner -
repo owner - changed status to invalid
As designed. You don't expect any returned PHP variable to exist, if you ignore it, do you? So that's the same thing.
-
reporter ok, i agree :)
- Log in to comment