Hi!

> What people objected to:
>  * Stas: The bool(true) return value does not really make sense.
> Instead the previous error/exception handler should be returned, as
> always.
>  * Pierre: One shouldn't be able to reset the error/exception handler
> like that in any case. This behavior should be removed and instead
> there should be additional reset_error_handler() and
> reset_exception_handler() functions (and also get_error_handler() and
> get_exception_handler() if I got that right.)

I don't think ability to reset handlers by passing null is a big
problem, and creating another four functions seems excessive to me.
Also, the use case for the latter ones is not clear - why would you need
old error handler if you are not changing it? If you are changing it,
the case for getting the old one is clear - you may want to restore it
later. But if you're not, why you'd need it?

As for returning true on null, I see no sense if this behavior. Can
anybody explain to me what is it useful for? Why not return old handler
just as it is done in all other cases of setting the handler?

> What I would do:
>  Add support for set_error_handler(NULL) and change the return value
> of set_error_handler(NULL)+set_exception_handler(NULL) to the previous
> handler (i.e. Stas option). I implemented this option in this PR:
> https://github.com/php/php-src/pull/20

I think this makes sense (of course, since it's my proposal :). It is a
behavior change, so it should be confined to master branch.

-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

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

Reply via email to