|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #46384 expr() or continue;
Submitted: 2008-10-25 13:08 UTC Modified: 2011-04-08 21:54 UTC
Avg. Score:3.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: zyss at mail dot zp dot ua Assigned:
Status: Open Package: Scripting Engine problem
PHP Version: 5.2.6 OS: RHEL4, WinXP
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-10-25 13:08 UTC] zyss at mail dot zp dot ua
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

Having this functionality would be very convenient as a short form of the following:

  if (!foo($bar)) continue;  // or break


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-27 16:58 UTC] info at netmosfera dot it
because "break" and "continue" can't represents boolean values :)
 [2008-10-27 20:09 UTC] zyss at mail dot zp dot ua
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.
 [2011-04-08 21:54 UTC]
-Package: Feature/Change Request +Package: Scripting Engine problem
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Oct 30 20:01:24 2020 UTC