#40712 [Opn->Bgs]: return after "or"

From: Date: Sun, 04 Mar 2007 04:09:31 +0000
Subject: #40712 [Opn->Bgs]: return after "or"
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-109853@lists.php.net to get a copy of this message
ID: 40712 Updated by: iliaa@php.net Reported By: s dot j dot t dot mocking at students dot uu dot nl -Status: Open +Status: Bogus Bug Type: *Programming Data Structures Operating System: Linux (Debian Testing) PHP Version: 5.2.1 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php . Previous Comments: ------------------------------------------------------------------------ [2007-03-03 18:54:25] s dot j dot t dot mocking at students dot uu dot nl 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 this bug report at http://bugs.php.net/?id=40712&edit=1

« previous php.bugs (#109853) next »