-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Debug] simplify error_reporting levels given php version > 5.3 #16916
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
Conversation
@@ -42,7 +42,7 @@ public static function enable($errorReportingLevel = null, $displayErrors = true | |||
if (null !== $errorReportingLevel) { | |||
error_reporting($errorReportingLevel); | |||
} else { | |||
error_reporting(-1); | |||
error_reporting(E_ALL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add a deprecation for the null
case in 3.1 as it is useless now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might become an issue in the future when new constants are introduced in future PHP versions (similar to the introduction of the E_STRICT
constant).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The E_ALL is supposed to include everything which is why it was changed in 5.4
@nicolas-grekas this is for you to review :) |
Ack, I should be able to do it tomorrow
|
What about defining the |
E_ALL has a different meaning in PHP 5.3 and >= 5.4. That is problem. So we cannot do anything in Polyfill. |
@Tobion I see, but then treating |
Since PHP 7 introduced exceptions in the core, I seriously doubt that any new |
Thank you @Tobion. |
…n > 5.3 (Tobion) This PR was merged into the 3.0 branch. Discussion ---------- [Debug] simplify error_reporting levels given php version > 5.3 | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Since PHP 5.4 `E_ALL` contains `E_STRICT`. This allows us to simplify and clean up some code. Commits ------- b1c774f simplify debug error_reporting levels given php version > 5.3
I thought symfony always used |
Neither symfony nor php itself uses null by default when it doesn't make sense. E.g. http://php.net/manual/en/function.trigger-error.php |
PHP does in other cases, where the param might end up being an int though. |
Meh. I'm inclined to agree with you I guess. |
Since PHP 5.4
E_ALL
containsE_STRICT
. This allows us to simplify and clean up some code.