note 54732 deleted from function.include by nlopess

From: Date: Mon, 18 Jul 2005 10:46:31 +0000
Subject: note 54732 deleted from function.include by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-92103@lists.php.net to get a copy of this message
Note Submitter: janich at gmail dot com ---- Be aware; If the included file contains bogus php, it results in a parse error which is NOT handled at the (not even custom) errorhandler. There seems to be no way to validate a php files content from within a script except for the 'php -l' option, which is quite unhandy in some (most) cases. (php_check_syntax is removed from v. 5.0.5) Its sad, because you can do all the checking you want and then try to include/require the file and end up with a 'not handable' parse error. Someone wrote at the error_reporting man page: "It seems that parse errors will be handled internally even if you've designated your own error handler; that is, your error-handling function will /not/ be called on a parse error." And that was 4 years ago ... Hope this spares someone for a few hours of headache.. I could have used it a few hours ago.

« previous php.notes (#92103) next »