Bug #73635 [Opn->Fbk]: error_get_last() returns null after set_error_handler();
| From: | requinix@php.net | Date: | Thu, 01 Dec 2016 16:35:41 +0000 |
| Subject: | Bug #73635 [Opn->Fbk]: error_get_last() returns null after set_error_handler(); | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-205719@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: requinix@php.net
Reported by: alon dot wrk at gmail dot com
Summary: error_get_last() returns null after
set_error_handler();
-Status: Open
+Status: Feedback
Type: Bug
Package: *General Issues
Operating System: DEB jessie
PHP Version: 7.0.13
Block user comment: N
Private report: N
New Comment:
That code showed NULL in 5.4 too. https://3v4l.org/tcTvu
Previous Comments:
------------------------------------------------------------------------
[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