php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #10483 someFunction() OR break;
Submitted: 2001-04-24 22:17 UTC Modified: 2001-04-25 05:27 UTC
From: fabiankessler at usa dot net Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.4 OS: all
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: fabiankessler at usa dot net
New email:
PHP Version: OS:

 

 [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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-25 05:27 UTC] hholzgra@php.net
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(...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 28 10:01:29 2024 UTC