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