示例#1
0
 /**
  * Here we add a new nextTick function as we're in the middle of a current
  * nextTick.
  */
 function testNextTickStacking()
 {
     $loop = new Loop();
     $check = 0;
     $loop->nextTick(function () use(&$check, $loop) {
         $loop->nextTick(function () use(&$check) {
             $check++;
         });
         $check++;
     });
     $loop->run();
     $this->assertEquals(2, $check);
 }