Giovanni Giacobbi wrote on 12/01/2016 09:37:
But the fact is that it did NOT exist, so when you say "other than the
specific transition to PHP 7", well I think it is a big deal and
motivates the introduction of a new feature just for that.
I guess what I meant was, once everyone has been using PHP 7 for years,
it would be a shame to have features lying around in the language that
existed only to ease the transition, and aren't even "legacy" in the
sense of matching PHP 5.
1) Check the handler's signature compatibility before calling it.
Indeed there is no reason to fix a my_hnd(Exception $e) and not a
my_hnd(ExceptionA $e) where class ExceptionA extends Exception, so
this proposal would be to simply ignore the set_handler_exception()'s
callback if it is not compatible, or maybe even better issue an
E_NOTICE or E_STRICT in such case.
I like this idea. Although I can't think of many cases outside the
transition where it would be deliberately used, generating a fatal error
when calling an error handler is not particular helpful, so just falling
through and acting as though no handler existed would seem like a more
useful fallback. I don't know how simple it would be to implement in the
engine though...
Just on a general point, there's actually surprisingly *few* BC breaks
in PHP 7, in my opinion. I don't think it's fair to extrapolate from
this a "general attitude to the community" - I think it's an unfortunate
BC break which could have had more attention, either to ensure it was
clearly signalled, or to look at mitigation ideas like we are in this
thread. An honest mistake, rather than somebody not caring.
Regards,
--
Rowan Collins
[IMSoP]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php