在没有警告的情况下检查变量是否为空

Check if a variable is null without warnings

在 PHP if 语句中,我想检查变量是否为空:

if (!is_null($datos))

检查成功,但我收到来自 xdebug 的警告:

如何在没有警告的情况下检查变量?

使用isset确保变量存在:

if(isset($datos)){...}

希望这对您有所帮助,