walkor 8 tahun lalu
induk
melakukan
0db65635cf
1 mengubah file dengan 4 tambahan dan 3 penghapusan
  1. 4 3
      Events/Select.php

+ 4 - 3
Events/Select.php

@@ -139,11 +139,12 @@ class Select implements EventInterface
                 break;
             case self::EV_TIMER:
             case self::EV_TIMER_ONCE:
+                $timer_id = $this->_timerId++;
                 $run_time = microtime(true) + $fd;
-                $this->_scheduler->insert($this->_timerId, -$run_time);
-                $this->_eventTimer[$this->_timerId] = array($func, (array)$args, $flag, $fd);
+                $this->_scheduler->insert($timer_id, -$run_time);
+                $this->_eventTimer[$timer_id] = array($func, (array)$args, $flag, $fd);
                 $this->tick();
-                return $this->_timerId++;
+                return $timer_id;
         }
 
         return true;