Skip to content

Commit d9a186d

Browse files
Merge branch '9.6' into 10.5
2 parents a2ac227 + bc0b86c commit d9a186d

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

ChangeLog-10.5.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes of the PHPUnit 10.5 release series are documented in this fi
44

55
## [10.5.35] - 2024-MM-DD
66

7+
### Changed
8+
9+
* [#5956](https://github.com/sebastianbergmann/phpunit/issues/5956): Deprecation of the `E_STRICT` constant in PHP 8.4
10+
711
### Fixed
812

913
* [#5950](https://github.com/sebastianbergmann/phpunit/pull/5950): TestDox text should not be `trim()`med when it contains `$` character

src/Runner/ErrorHandler.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use const E_USER_NOTICE;
2525
use const E_USER_WARNING;
2626
use const E_WARNING;
27+
use function defined;
2728
use function error_reporting;
2829
use function restore_error_handler;
2930
use function set_error_handler;
@@ -63,14 +64,22 @@ public function __invoke(int $errorNumber, string $errorString, string $errorFil
6364
return false;
6465
}
6566

67+
/**
68+
* E_STRICT is deprecated since PHP 8.4.
69+
*
70+
* @see https://github.com/sebastianbergmann/phpunit/issues/5956
71+
*/
72+
if (defined('E_STRICT') && $errorNumber === @E_STRICT) {
73+
$errorNumber = E_NOTICE;
74+
}
75+
6676
$test = Event\Code\TestMethodBuilder::fromCallStack();
6777

6878
$ignoredByBaseline = $this->ignoredByBaseline($errorFile, $errorLine, $errorString);
6979
$ignoredByTest = $test->metadata()->isIgnoreDeprecations()->isNotEmpty();
7080

7181
switch ($errorNumber) {
7282
case E_NOTICE:
73-
case E_STRICT:
7483
Event\Facade::emitter()->testTriggeredPhpNotice(
7584
$test,
7685
$errorString,

0 commit comments

Comments
 (0)