note 104397 added to function.set-error-handler
| From: | francoisrv at osu1 dot php dot net | Date: | Mon, 13 Jun 2011 15:48:38 +0000 |
| Subject: | note 104397 added to function.set-error-handler | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-180486@lists.php.net to get a copy of this message | ||
About what perikilis said, something to note. A shutdown function is executed when PHP closes, not
when an error occurred. If when PHP is done no error has occurred, error_get_last() returns null, so
trying to access it as an array will cause an error, defeating its purpose. A fix will be:
<?php
$error = error_get_last();
if(!is_null($error)){
if ($error['type'] == 1) {
//do your stuff
}
}
----
Server IP: 69.147.83.197
Probable Submitter: 90.169.76.57
----
Manual Page -- http://www.php.net/manual/en/function.set-error-handler.php
Edit -- https://master.php.net/note/edit/104397
Del: integrated -- https://master.php.net/note/delete/104397/integrated
Del: useless -- https://master.php.net/note/delete/104397/useless
Del: bad code -- https://master.php.net/note/delete/104397/bad+code
Del: spam -- https://master.php.net/note/delete/104397/spam
Del: non-english -- https://master.php.net/note/delete/104397/non-english
Del: in docs -- https://master.php.net/note/delete/104397/in+docs
Del: other reasons-- https://master.php.net/note/delete/104397
Reject -- https://master.php.net/note/reject/104397
Search -- https://master.php.net/manage/user-notes.php