我有这个代码
$return = $ep->$method($params);
if ($return === null) {
throw new Exception('Endpoint has no return value');
}
return $return;
Run Code Online (Sandbox Code Playgroud)
有没有办法区分返回null的方法和不返回任何内容的方法?
Wil*_*iam 33
这是不可能的.如果未设置返回值,则该函数自动返回null.