Daniel Convissor wrote:

Just supply it in both PHP 4 and 5 - extra arguments are ignored anyway


Nope...


CODE
----
echo phpversion();
set_error_handler('error_handler', 0);
function error_handler($code, $text) {
   echo "<br />Handled... $text";
}
$x;

OUTPUT
------
4.3.4
Warning:  Wrong parameter count for set_error_handler() in y on line 4
Notice:  Undefined variable:  x in y on line 8




(just provide @ to make sure of that).



Nope... Sure, adding a @ to the set_error_handler() call supresses the
parameter count warning. But, since set_error_handler() failed, the error handler doesn't get called...


OUTPUT
------
4.3.4
Notice:  Undefined variable:  x in y on line 8



We are not supposed to change 4.3.x right?
So the code with @ is "working". The set_error_handler() is bailing out
and everything is ok (as it has been till now). But this statement
will work (if the decision is to add additional optional param) on PHP5
which is the aim. So an optional parameter and a @ in the front should
help (no matter that @ is ugly). I think this is the idea of Zeev.

--Dan



Andrey

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to