|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-12-18 11:20 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 20:00:01 2025 UTC |
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 }