Possible Duplicate:
PHP short circuit lazy evaluation, where is it in the php.net manual?
PHP “or” Syntax
I have seen people using the ||
operator as program flow control as follows:
function() || die("message");
where die("message");
will run if function()
returns false
. Furthermore, it seems to only work for die();
and exit();
else the interpreter will throw a "syntax error" message.
I'm wondering what this is called and where can I find documentation for its behaviour.