|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-02-15 13:01 UTC] sander@php.net
[2002-06-18 19:24 UTC] sniper@php.net
[2002-09-04 12:23 UTC] phpuser at jvhovig dot remove dot three dot words dot com
[2004-06-20 07:36 UTC] michaelaskew at mac dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 04:00:01 2025 UTC |
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.