谁能给我解释一下吗?
var_dump([
defined('empty'),
function_exists('empty'),
is_callable('empty'),
empty(0),
empty(1),
]);
array (size=5)
0 => boolean false
1 => boolean false
2 => boolean false
3 => boolean true
4 => boolean false
我明明可以使用empty
,那为什么PHP会报告它未定义、不存在、不可调用呢? 😟
最佳答案
然后我当然找到了......
A PHP function is passed by its name as a string. Any built-in or user-defined function can be used, except language constructs such as: array(), echo, empty(), eval(), exit(), isset(), list(), print or unset().
关于php - 为什么存在empty() "not"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42106060/