From:             php at maisqi dot com
Operating system: Win7 32 bits
PHP version:      5.4.12
Package:          *General Issues
Bug Type:         Bug
Bug description:set_error_handler always return handler if called inside an 
error_handler

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 bug report at https://bugs.php.net/bug.php?id=64312&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=64312&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=64312&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=64312&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=64312&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=64312&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=64312&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=64312&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=64312&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=64312&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=64312&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=64312&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=64312&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=64312&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64312&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=64312&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=64312&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=64312&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64312&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=64312&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64312&r=mysqlcfg

Reply via email to