开发者

"boolean and include .." works but "boolean and unset($v)" reports syntax error in PHP?

开发者 https://www.devze.com 2023-01-02 00:33 出处:网络
This works: !function_exists(\'testf开发者_如何学编程unc\') and include(\"testfunc.php\"); This will report syntax error:

This works:

!function_exists('testf开发者_如何学编程unc') and include("testfunc.php");

This will report syntax error:

!function_exists('testfunc') and unset($q);

Aren't they the same thing?


unset has no return value and according to http://php.net/manual/en/function.include.php you can "return" from the included file (so it's not void :P)

...I'm pretty sure that's what it is


unset is void, it returns no value.

include can return a value, which is the return value defined in the file included. might be bool, might be something else. In general it's not recomended to use it that way.

0

精彩评论

暂无评论...
验证码 换一张
取 消