Bug #64312 [Com]: set_error_handler always return handler if called inside an error_handler

From: Date: Wed, 27 Feb 2013 15:45:43 +0000
Subject: Bug #64312 [Com]: set_error_handler always return handler if called inside an error_handler
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-177440@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=64312&edit=1

 ID:                 64312
 Comment by:         php at maisqi dot com
 Reported by:        php at maisqi dot com
 Summary:            set_error_handler always return handler if called
                     inside an error_handler
 Status:             Open
 Type:               Bug
 Package:            *General Issues
 Operating System:   Win7 32 bits
 PHP Version:        5.4.12
 Block user comment: N
 Private report:     N

 New Comment:

Test script: http://maisqi.com/outros/bugs/php/64312


Previous Comments:
------------------------------------------------------------------------
[2013-02-27 15:43:04] php at maisqi dot com

Description:
------------
If you set an error handler when inside an error handling function, set_error_handler will always
return NULL.

Test script:
---------------
<pre>
<?php

function first_handler () {
		echo "  first_handler\n";
		echo '     Set to second handler: <strong>', gettype (set_error_handler
('second_handler')), "</strong>\n";
		echo "\n\n", '$y = $o', "\n";
		$y = $o;
}
function second_handler () {
		echo "  second_handler\n";
}

set_error_handler ('first_handler');
echo '$x = $y', "\n";
$x = $y;
echo '     Set to other handler: <strong>', gettype (set_error_handler
(function(){})), "</strong>\n";


Expected result:
----------------
set_error_handler should return the name of the error handling function, which in this case would be
the name of the running function.

Actual result:
--------------
It just returns null.


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64312&edit=1


Thread (1 message)

  • php at maisqi dot com
  • Unknown Message
    • php at maisqi dot com
« previous php.bugs (#177440) next »