ID: 50515
Updated by: [email protected]
Reported By: ntpt at seznam dot cz
-Status: Open
+Status: Bogus
-Bug Type: *Programming Data Structures
+Bug Type: Feature/Change Request
Operating System: linux
PHP Version: 5.2.12
New Comment:
Never happens.
Previous Comments:
------------------------------------------------------------------------
[2009-12-18 10:26:52] ntpt at seznam dot cz
Description:
------------
please allow return() in lazy evaluation /short-circuit syntax like
$result=do_something($blah) or die('nothing done'); // this works
but
$result=do_something($blah) or return(false) ; // does NOT work
I thing it is prety legitimate not only to call die() if do_something()
return false, but in this case return() from function or include() as
well. I thing it is more cleaner and readable then bunch of
$result=do_something($blah)
if ($result==false){
return false;}
// use you result here
Maybe even codeblock after "or" is worth of considerations
$result=do_something($blah) or { // codeblock, do what you want here
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50515&edit=1