diff --git a/src/Helper/PhpHelper.php b/src/Helper/PhpHelper.php index 283c7101..984f9d7b 100644 --- a/src/Helper/PhpHelper.php +++ b/src/Helper/PhpHelper.php @@ -46,7 +46,11 @@ public static function call($cb, array $args = []) list($obj, $mhd) = $cb; $ret = \is_object($obj) ? $obj->$mhd(...$args) : $obj::$mhd(...$args); } else { - $ret = \Swoole\Coroutine::call_user_func_array($cb, $args); + if (SWOOLE_VERSION >= '4.0') { + $ret = call_user_func_array($cb, $args); + } else { + $ret = \Swoole\Coroutine::call_user_func_array($cb, $args); + } } return $ret;