LMLPHP后院

PHP Fatal error: Can't use function return value in write context技术

maybe yes 发表于 2017-05-23 22:35

经常写代码的你,是否遇到过这样的错误: FastCGI sent in stderr: "PHP message: PHP Fatal error:  Can't use function return value in write context in ...

这是与 php 版本有关的报错,不能使用函数返回值作为函数参数,5.5 之后就不会有。

if (empty(self::conn())) return false;

empty function can be used only for variables and if you pass anything else, it will throw a parse error:

$var = shell_exec("which $command");
if (empty($var)) {
    return false;
}
2024-05-09 04:53:43 1715201623 0.021367