php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #35459 Fatal error: User error handler must not modify error context in....
Submitted: 2005-11-28 23:39 UTC Modified: 2005-11-29 14:25 UTC
From: eugenio dot tacchini at unicatt dot it Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.4.1 OS: Linux
Private report: No CVE-ID: None
 [2005-11-28 23:39 UTC] eugenio dot tacchini at unicatt dot it
Description:
------------
This bug http://bugs.php.net/bug.php?id=25922 seems to be still reprodusabe in PHP 4.4.1. PHP doesn't crash but produce the message reported below.


Reproduce code:
---------------
  function my_error_handler( $error, $errmsg = '', $errfile = '',
$errline = 0, $errcontext = '' )
    {
        $errcontext = '';
    }
                                                                        
                          
    set_error_handler( 'my_error_handler' );
                                                                        
                          
    function test( $headers = '' )
    {
        echo "Undefined index here: '{$data['HTTP_HEADER']}'\n";
    }
                                                                        
                              test();

Expected result:
----------------
Undefined index here: ''

Actual result:
--------------
Fatal error: User error handler must not modify error context in....

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-28 23:43 UTC] tony2001@php.net
The error message is pretty clear, isn't it?
 [2005-11-28 23:56 UTC] eugenio dot tacchini at unicatt dot it
Yes, it is, but that piece of code doesn't produce the error in previous versions of PHP, do it?
 [2005-11-28 23:58 UTC] eugenio dot tacchini at unicatt dot it
I have tried the code on php-4.3.4-Win32 and I get
Undefined index here: ''
as expected.
 [2005-11-29 00:04 UTC] tony2001@php.net
Right, because you could crash PHP by modifying error context.
That's why you're not allowed to modify it anymore.
 [2005-11-29 00:30 UTC] eugenio dot tacchini at unicatt dot it
You are right but this change breaks compatibility with applications developed with a previous PHP version, and I haven't found mention in the change log nor here: http://it2.php.net/set_error_handler.

Is this a documentation bug?
 [2005-11-29 14:25 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.

"User error handler must not modify error context."
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 17 18:01:31 2024 UTC