Bug #10483 Updated: someFunction() OR break;
| From: | hholzgra@php.net | Date: | Wed, 25 Apr 2001 09:27:37 +0000 |
| Subject: | Bug #10483 Updated: someFunction() OR break; | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-52370@lists.php.net to get a copy of this message | ||
ID: 10483
Updated by: hholzgra
Reported By: fabiankessler@usa.net
Old-Status: Open
Status: Closed
Bug Type: Feature/Change Request
PHP Version: 4.0.4
Assigned To:
Comments:
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(...
Previous Comments:
---------------------------------------------------------------------------
[2001-04-24 22:17:39] fabiankessler@usa.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
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10483&edit=2