Ver código fonte

Update Select.php

walkor 10 anos atrás
pai
commit
7e5c142a9f
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      Events/Select.php

+ 2 - 2
Events/Select.php

@@ -90,7 +90,7 @@ class Select implements EventInterface
      * 添加事件及处理函数
      * @see Events\EventInterface::add()
      */
-    public function add($fd, $flag, $func, $args = null)
+    public function add($fd, $flag, $func, $args = array())
     {
         switch ($flag)
         {
@@ -114,7 +114,7 @@ class Select implements EventInterface
                 // $fd 为 定时的时间间隔,单位为秒,支持小数,能精确到0.001秒
                 $run_time = microtime(true)+$fd;
                 $this->_scheduler->insert($this->_timerId, -$run_time);
-                $this->_task[$this->_timerId] = array($func, $args, $flag, $fd);
+                $this->_task[$this->_timerId] = array($func, (array)$args, $flag, $fd);
                 $this->tick();
                 return $this->_timerId++;
         }