php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #31675 restore_error_handler() not work inside error handler
Submitted: 2005-01-24 07:35 UTC Modified: 2005-04-05 15:09 UTC
From: zxd at zhangxiaodong dot net Assigned:
Status: Closed Package: Documentation problem
PHP Version: 5.0.3 OS: RedHat Linux AS3 2.4.21-20 i686
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: zxd at zhangxiaodong dot net
New email:
PHP Version: OS:

 

 [2005-01-24 07:35 UTC] zxd at zhangxiaodong dot net
Description:
------------
when call restore_error_handler() inside an error handler function, it not works.

Reproduce code:
---------------
<?php

function t35_handler($no, $msg){
    echo __LINE__.__METHOD__."\n";
    restore_error_handler();
    echo __LINE__.__METHOD__."\n";
}
function t35(){
    echo "old handler=".set_error_handler("t35_handler")."\n";
    trigger_error("error1");
    echo "old handler=".set_error_handler("t35_handler")."\n";
    trigger_error("error2");
}


?>

Expected result:
----------------
old handler=
4t35_handler
6t35_handler
old handler=
4t35_handler
6t35_handler


Actual result:
--------------
old handler=
4t35_handler
6t35_handler
old handler=t35_handler
4t35_handler
6t35_handler


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-05 15:09 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

"Calling restore_error_handler() from the error_handler function is ignored."
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 01:01:28 2024 UTC