开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜