Source

pecl-ev / tests / 09_loop_timer.phpt

Diff from to

File tests/09_loop_timer.phpt

 $base = $l->now();
 $prev = $l->now();
 
+$timer = array();
+$periodic = array();
+
 for ($i = 1; $i <= /*125*/25; ++$i) {
 	$t = $i * $i * 1.735435336;
 	$t -= (int) $t;
-	$timer = $l->timer($t, 0, function ($w, $r)
+	$timer[] = $l->timer($t, 0, function ($w, $r)
 		use (&$id, &$prev, $base, $i, $t, $fudge) {
 			$now = $w->getLoop()->now();
 
 
 	$t = $i * $i * 1.375475771;
 	$t -= (int) $t;
-	$periodic = $l->periodic($base + $t, 0, NULL, function ($w, $r)
+	$periodic[] = $l->periodic($base + $t, 0, NULL, function ($w, $r)
 		use (&$id, &$prev, $base, $i, $t, $fudge) {
 			$now = $w->getLoop()->now();
 
 $l->run();
 print "ok 152\n";
 
+$timer = null;
+$periodic = null;
 ?>
 --EXPECTF--
 ok 1