note 40739 added to function.require

From: Date: Fri, 12 Mar 2004 17:10:41 +0000
Subject: note 40739 added to function.require
Groups: php.notes 
Request: Send a blank email to php-notes+get-66742@lists.php.net to get a copy of this message
NOTE: This function changed how it worked. In PHP 3 this behaved very differently than it does on PHP 4. Require used to include and parse the file regardless where the require line was positioned. For example (PHP3): <?php if(false){ require 'file_does_not_exist.php'; } ?> That code throw a fatal exception even though it's in a conditional block which evaluates to false. In PHP 4 the file is never included or parsed, so no exception is thrown. For example (PHP4) <?php if(false){ require '1_file_does_not_exists.php'; } require '2_file_does_not_exists.php'; ?> Stops execution of the script on trying to require the 2nd file...by bypasses the first require. --JM ---- Manual Page -- http://www.php.net/manual/en/function.require.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+40739 Delete -- http://master.php.net/manage/user-notes.php?action=delete+40739&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+40739&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#66742) next »