note 54732 added to function.include

From: Date: Wed, 13 Jul 2005 22:53:45 +0000
Subject: note 54732 added to function.include
Groups: php.notes 
Request: Send a blank email to php-notes+get-91925@lists.php.net to get a copy of this message
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. ---- Manual Page -- http://www.php.net/manual/en/function.include.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+54732 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54732&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54732&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54732&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54732&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54732&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54732&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+54732&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#91925) next »