|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-04-24 22:17 UTC] fabiankessler at usa dot net
why is the syntax
someFunction() OR anotherFunction();
only possible with a function on the right side of the OR? cause it has to return something?
would be nice to be able to to someFunction() OR break;
example:
$success = FALSE;
do { // try block
doSomething("foo") OR break;
doSomething("bar") OR break;
doSomething("hello") OR break;
doSomething("world") OR break;
$success = TRUE;
} while (FALSE);
echo ($success) ? 'yes' : 'no';
greetings
fab
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 00:00:01 2025 UTC |
thats because 'break' is a keyword, not a function break as a languag construct has no value and may not be used in expressions btw: the same holds true for 'if', 'for', ... you cannot say doSomething("...") OR if(...