#46384 [Opn]: expr() or continue;
| From: | zyss at mail dot zp dot ua | Date: | Mon, 27 Oct 2008 20:09:45 +0000 |
| Subject: | #46384 [Opn]: expr() or continue; | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-130226@lists.php.net to get a copy of this message | ||
ID: 46384
User updated by: zyss at mail dot zp dot ua
Reported By: zyss at mail dot zp dot ua
Status: Open
Bug Type: Feature/Change Request
Operating System: RHEL4, WinXP
PHP Version: 5.2.6
New Comment:
Yes, that's pretty obvious, but PHP could be modified to be able to do
that. This change will make code more clear (like ?: operator) therefore
it is worth implementing.
Previous Comments:
------------------------------------------------------------------------
[2008-10-27 16:58:47] info at netmosfera dot it
because "break" and "continue" can't represents boolean values :)
------------------------------------------------------------------------
[2008-10-25 21:11:06] zyss at mail dot zp dot ua
try
------------------------------------------------------------------------
[2008-10-25 13:08:22] zyss at mail dot zp dot ua
Description:
------------
Why it is possible to write:
foo() or die("Can't foo");
but impossible to write:
foreach ($bars as $bar) {
foo($bar) or contine; // or break
do_something($bar);
}
Having this functionality would be very convenient as a short form of
the following:
if (!foo($bar)) continue; // or break
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46384&edit=1