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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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: Thu Apr 25 15:01:30 2024 UTC