#22342 [Opn->Bgs]: the behaviour of require(..) or die(..); is non-intuitive

From: Date: Fri, 21 Feb 2003 10:51:13 +0000
Subject: #22342 [Opn->Bgs]: the behaviour of require(..) or die(..); is non-intuitive
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969351895@lists.php.net to get a copy of this message
ID: 22342 Updated by: sniper@php.net Reported By: peter-phpbug at dataloss dot nl -Status: Open +Status: Bogus Bug Type: Documentation problem Operating System: Linux PHP Version: 4.3.1 New Comment: require() dies with fatal error if file is not found.. Previous Comments: ------------------------------------------------------------------------ [2003-02-20 18:14:23] peter-phpbug at dataloss dot nl If one would use a line similar to require("include/xhtml11.php") or die("argh!"); php will fail stating it cannot open "1". The more intuitive result can be obtained by doing (require("include/xhtml11.php")) or die("argh!"); I know that require or die is wrong, since require is not a function. However, due to the way precedence (apparently) works with require, the result is non-intuitive and confusing (I am assuming php is evaluating '(..) or die(..)' to 'true', which is 1). ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22342&edit=1

« previous php.doc (#969351895) next »