Conversation
PHPUnit/Framework/TestResult.php
Outdated
| $errorLevels = E_ALL | E_STRICT; | ||
| if (PHP_VERSION_ID >= 70400) { | ||
| $errorLevels = E_ALL; | ||
| } |
There was a problem hiding this comment.
I think it'd be safer to reverse the condition, and use E_STRICT only inside a condition block.
There was a problem hiding this comment.
@falkenhawk True, thank you!
Edit: done!
|
|
||
| if ($errno == E_NOTICE || $errno == E_USER_NOTICE || $errno == E_STRICT) { | ||
| if ($errno == E_NOTICE || $errno == E_USER_NOTICE | ||
| || (PHP_VERSION_ID < 70400 && $errno == E_STRICT)) { |
There was a problem hiding this comment.
| || (PHP_VERSION_ID < 70400 && $errno == E_STRICT)) { | |
| || (PHP_VERSION_ID < 80400 && $errno == E_STRICT)) { |
Shouldn't the deprecation start with 8.4? not 7.4?
There was a problem hiding this comment.
@glensc According to this, some functions already emit deprecation notice starting 7.4:
https://php.watch/versions/8.4/E_STRICT-deprecated
There was a problem hiding this comment.
from the linked article:
It is safe to assume that any PHP applications that run on PHP 8.0 and later will never encounter E_STRICT notices
but still the correct check would be <= 70400 or < 80000 instead of < 70400 @marcing
| $errorLevels = E_ALL; | ||
| if (PHP_VERSION_ID < 70400) { | ||
| $errorLevels = E_ALL | E_STRICT; | ||
| } |
There was a problem hiding this comment.
alternatives:
single line:
$errorLevels = PHP_VERSION_ID < 70400 ? E_ALL | E_STRICT : E_ALL;`multiline:
$errorLevels = E_ALL;
if (PHP_VERSION_ID < 70400) {
$errorLevels |= E_STRICT;
}There was a problem hiding this comment.
I believe the current one is clear enough and easy to understand.
PHP 8.4: E_STRICT constant deprecated
https://php.watch/versions/8.4/E_STRICT-deprecated