note 49319 added to function.include

From: Date: Mon, 24 Jan 2005 01:39:49 +0000
Subject: note 49319 added to function.include
Groups: php.notes 
Request: Send a blank email to php-notes+get-83852@lists.php.net to get a copy of this message
Parse errors are not trapped in PHP 5.0.1 (probably other versions) with include(). Execution still stops the script. This differs from PHP 4. This is a shame as you could detect and react to errors with... $old = ini_get('track_errors'); ini_set('track_errors', true); include($file); ini_set('track_errors', $old); if (isset($php_errormsg)) { // Perform remedial action } ...but alas, not with PHP 5. ---- Manual Page -- http://www.php.net/manual/en/function.include.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+49319 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49319&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49319&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49319&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49319&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49319&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+49319&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#83852) next »