For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > November 2005 > #35459 [Bgs->Opn]: Fatal error: User error handler must not modify error context i









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author #35459 [Bgs->Opn]: Fatal error: User error handler must not modify error context i
eugenio dot tacchini at unicatt dot it

2005-11-28, 6:57 pm

ID: 35459
User updated by: eugenio dot tacchini at unicatt dot it
Reported By: eugenio dot tacchini at unicatt dot it
-Status: Bogus
+Status: Open
-Bug Type: Scripting Engine problem
+Bug Type: Documentation problem
Operating System: Linux
PHP Version: 4.4.1
New Comment:

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?


Previous Comments:
------------------------------------------------------------------------

[2005-11-29 00:04:55] 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-28 23:58:53] 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-28 23:56:10] 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:43:05] tony2001@php.net

The error message is pretty clear, isn't it?

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

[2005-11-28 23:39:15] 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....


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


--
Edit this bug report at http://bugs.php.net/?id=35459&edit=1
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com