-
Notifications
You must be signed in to change notification settings - Fork 823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX: Handle E_RECOVERABLE_ERROR (fixes #2928) #2951
FIX: Handle E_RECOVERABLE_ERROR (fixes #2928) #2951
Conversation
Maybe it would be good to add a default case which returns a fatal handler? That way we eliminate the risk of silently hiding errors. |
Yep, definitely think we need a default case for this. Are you happy for me to add that to this pull request or would a separate one be preferred? |
I reckon do it in this one, may as well fully solve it. You can probably just move the fatal error handler to the end of the switch, get rid of all the cases for it, and make it the default. I think that would be the best fix. |
The only concern I have is that this might be an upgrading issue, so it might be best to go into master. Any thoughts on that @chillu or @simonwelsh? |
This is a massive upgrading issue. The amount of places where I've seen code, even in the CMS, that this will break is staggering. I feel like it should be a non-fatal warning in 3.2 (like an E_DEPRECATED) and then changed into a fatal for 4. |
@simonwelsh Sure, I’m fine with that - it’s an improvement on the errors not showing at all! So:
Are you happy with these two changes being made against master? |
I'd just add default to the list of fatal cases. I like making things like this explicit, for readability, rather than just relying on default behaviour. |
Fair enough. In any case though, I think we should add a default case that throws an exception or something so this doesn't happen again. I agree that moving to a non-fatal warning in the master branch is the way to go. |
Just to outline this again:
I think I’ll also re-order the cases (ascending in severity) so the fatal group comes last, as that’s where you’d expect the default to be. All sound okay? |
Fine by me. Go for it! |
Re-opened in #2955. Also added a default/unknown error to |
See http://www.php.net/manual/en/errorfunc.constants.php