Bug #73635 [Fbk->NoF]: error_get_last() returns null after set_error_handler();
| From: | php-bugs at lists dot php dot net | Date: | Sun, 11 Dec 2016 04:22:23 +0000 |
| Subject: | Bug #73635 [Fbk->NoF]: error_get_last() returns null after set_error_handler(); | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-205909@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73635&edit=1
ID: 73635
Updated by: php-bugs@lists.php.net
Reported by: alon dot wrk at gmail dot com
Summary: error_get_last() returns null after
set_error_handler();
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: *General Issues
Operating System: DEB jessie
PHP Version: 7.0.13
Private report: N
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2016-12-01 17:10:02] cmb@php.net
Furthermore, error_get_last() returns the expected array, if the error handler returns FALSE. This
behavior hasn't changed neither, see <https://3v4l.org/87ovU>.
------------------------------------------------------------------------
[2016-12-01 16:35:41] requinix@php.net
That code showed NULL in 5.4 too. https://3v4l.org/tcTvu
------------------------------------------------------------------------
[2016-12-01 16:29:19] alon dot wrk at gmail dot com
Description:
------------
The next code:
<?php
$a["x"];//should trigger notice
var_dump(error_get_last());//return the error array
?>
runs perfectly and returns an error array.
but when I use set_error_handler it returns null
<?php
function _do_something(){}
set_error_handler('_do_something');
$a["x"];//should trigger notice
var_dump(error_get_last());//return null
?>
This code works perfectly on PHP5.4 I had changed 3 month ago to PHP7 and since then I am getting
nulls in error_get_last() I am using a shutdown function to check if an error has occured and if so
to send it to the developer.
The Problem exists in all type of errors notice,warning,error,fatal
Test script:
---------------
function _do_something(){}
set_error_handler('_do_something');
$a["x"];//should trigger notice
var_dump(error_get_last());//return null
Expected result:
----------------
I expect to get an array of the error, like in php 5.*
Actual result:
--------------
I am getting null instead of an array
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73635&edit=1