note 30996 deleted from function.require-once by sniper

From: Date: Tue, 04 Nov 2003 00:45:33 +0000
Subject: note 30996 deleted from function.require-once by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-59823@lists.php.net to get a copy of this message
Note Submitter: phresno@concept-factory.com ---- When including a file with require(_once) or include(_once), if the file has syntax errors, PHP will not execute any commands in the file. This can be especially annoying if you set your error reporting settings up in another file, and include it via require_once(). Example: <?php require_once("error_foo.php"); // some code strtoupper("bar") // oops, we left off a semi-colin ?> error_foo.php: <?php ini_set("display_errors", "1"); ini_set("html_errors", "1"); ini_set("error_reproting", E_ALL & ~E_NOTICE); $old_handler = set_error_handler("new_handler"); function new_handler() { // code that fails PHP's parse check } ?> If you default settings in this example are to supress errors (and for some reason you do not have error logging on), your script will fail, with no error reporting by PHP. You will have to fix the included file, or, place error report settings in the parent script for error reporting to be handled as directed.

« previous php.notes (#59823) next »