From:             [EMAIL PROTECTED]
Operating system: RH Linux 7.2 (kernel 2.4.9-21)
PHP version:      4.0.6
PHP Bug Type:     Compile Failure
Bug description:  Constructions involving "... or ..." don't work properly.

Script:

<?php
function foo() {
  $result = mysql_query("SELECT 1") or return false;  //fails
  print("foo") or return false; // fails
  print("foo") or return 0; // fails
  print("foo") or return(false); // fails
  $result = mysql_query("SELECT 1") or die(); // works
}
?>

This bug seems to be present in PHP versions 4.0.6, and 4.2.0 - it's been
tried on more than one machine (including two that I haven't installed
myself).  Essentially, constructions involving <expr1> or <expr2>, where
expr2 is a keyword (return, continue, break, etc) fail with a parse error,
whereas constructions where expr2 is a function (such as die() etc)
succeed.  This bug is not specific to the "or" keyword, either.  It also
occurs with the "and" keyword.
-- 
Edit bug report at http://bugs.php.net/?id=15515&edit=1
-- 
Fixed in CVS:        http://bugs.php.net/fix.php?id=15515&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=15515&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=15515&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=15515&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=15515&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=15515&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=15515&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=15515&r=submittedtwice

Reply via email to