From: s dot j dot t dot mocking at students dot uu dot nl Operating system: Linux (Debian Testing) PHP version: 5.2.1 PHP Bug Type: *Programming Data Structures Bug description: return after "or"
Description: ------------ "<statement> or die" works as expected, but "<statement> or return" results in syntax errors. Haven't found anything in the documentation which describes this behavior. If it's not a bug, it's very counterintuitive. Reproduce code: --------------- This works: function foo() { 0 or die("bla"); } This produces a syntax error: function bar() { 0 or return ("bla"); } Expected result: ---------------- I would expect bar() to return bla Actual result: -------------- Parse error: syntax error, unexpected T_RETURN -- Edit bug report at http://bugs.php.net/?id=40712&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40712&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40712&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40712&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=40712&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=40712&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=40712&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=40712&r=needscript Try newer version: http://bugs.php.net/fix.php?id=40712&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=40712&r=support Expected behavior: http://bugs.php.net/fix.php?id=40712&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=40712&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=40712&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=40712&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40712&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=40712&r=dst IIS Stability: http://bugs.php.net/fix.php?id=40712&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=40712&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=40712&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=40712&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=40712&r=mysqlcfg