note 64466 added to function.require

From: Date: Fri, 14 Apr 2006 21:55:48 +0000
Subject: note 64466 added to function.require
Groups: php.notes 
Request: Send a blank email to php-notes+get-108105@lists.php.net to get a copy of this message
Just a note: <?php @require( 'file.php' ) or die(); ?> will not work. Without the @, php will complain about it trying to require '1'. That's because of the () not being actually used by PHP: being the Require statement a language construct the statement will be interpreted as <?php @require ( 'file.php' or die() ); ?> And that's kinda useless, so you would need to use parentheses to force the wanted behavior: <?php ( @require( 'file.php' ) ) or die(); ?> Hope it saves some time to anyone! ---- Server IP: 213.92.11.19 Probable Submitter: 84.220.136.221 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.require.php Edit -- http://master.php.net/note/edit/64466 Del: integrated -- http://master.php.net/note/delete/64466/integrated Del: useless -- http://master.php.net/note/delete/64466/useless Del: bad code -- http://master.php.net/note/delete/64466/bad+code Del: spam -- http://master.php.net/note/delete/64466/spam Del: non-english -- http://master.php.net/note/delete/64466/non-english Del: in docs -- http://master.php.net/note/delete/64466/in+docs Del: other reasons-- http://master.php.net/note/delete/64466 Reject -- http://master.php.net/note/reject/64466 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#108105) next »