note 73239 added to function.set-error-handler

From: Date: Wed, 14 Feb 2007 12:22:55 +0000
Subject: note 73239 added to function.set-error-handler
Groups: php.notes 
Request: Send a blank email to php-notes+get-123367@lists.php.net to get a copy of this message
Unfortunately, none of the procedures described here by other users to catch all errors work. Then again this would be impossible as parse errors are triggered before the code is interpreted and executed so no code solution is possible (just as the documentation says). You can test them easily against this simple code: some_function_that_doesnt_exist(); using it in this form will trigger a Fatal Error (call to undefined function), which can't be caught by using your custom defined handler but *can* be caught by using the solutions presented by other programmers. if you remove the ; from the end will trigger a Parse Error (syntax error), which *can't* be caught by any of these solutions. If this called is however places as the last line of code, just before the ?> then it will again generate a Fatal Error (call to undefined function). if you further remove the () then you'll get a Notice (undefined constant) which can be caught by the manual method of defining a custom error handler. ---- Server IP: 69.147.83.197 Probable Submitter: 195.225.64.234 ---- Manual Page -- http://www.php.net/manual/en/function.set-error-handler.php Edit -- https://master.php.net/note/edit/73239 Del: integrated -- https://master.php.net/note/delete/73239/integrated Del: useless -- https://master.php.net/note/delete/73239/useless Del: bad code -- https://master.php.net/note/delete/73239/bad+code Del: spam -- https://master.php.net/note/delete/73239/spam Del: non-english -- https://master.php.net/note/delete/73239/non-english Del: in docs -- https://master.php.net/note/delete/73239/in+docs Del: other reasons-- https://master.php.net/note/delete/73239 Reject -- https://master.php.net/note/reject/73239 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#123367) next »