From:             peter-phpbug at dataloss dot nl
Operating system: Linux
PHP version:      4.3.1
PHP Bug Type:     Documentation problem
Bug description:  the behaviour of require(..) or die(..); is non-intuitive

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 bug report at http://bugs.php.net/?id=22342&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=22342&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=22342&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=22342&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=22342&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=22342&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=22342&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=22342&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=22342&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=22342&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=22342&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22342&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=22342&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=22342&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=22342&r=gnused


-- 
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to