Skip to content

Commit

Permalink
fix timer notice
Browse files Browse the repository at this point in the history
  • Loading branch information
walkor committed Nov 12, 2015
1 parent 78cd7ac commit 97f46de
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Workerman/Events/Libevent.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function __construct()
* 添加事件
* @see EventInterface::add()
*/
public function add($fd, $flag, $func, $args=null)
public function add($fd, $flag, $func, $args=array())
{
switch($flag)
{
Expand Down
4 changes: 2 additions & 2 deletions Workerman/Events/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function __construct()
* 添加事件及处理函数
* @see Events\EventInterface::add()
*/
public function add($fd, $flag, $func, $args = null)
public function add($fd, $flag, $func, $args = array())
{
switch ($flag)
{
Expand All @@ -114,7 +114,7 @@ public function add($fd, $flag, $func, $args = null)
// $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++;
}
Expand Down
2 changes: 1 addition & 1 deletion Workerman/Lib/Timer.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static function add($time_interval, $func, $args = array(), $persistent =
{
self::$_tasks[$run_time] = array();
}
self::$_tasks[$run_time][] = array($func, $args, $persistent, $time_interval);
self::$_tasks[$run_time][] = array($func, (array)$args, $persistent, $time_interval);
return true;
}

Expand Down

0 comments on commit 97f46de

Please sign in to comment.