Skip to content

Commit ca4f132

Browse files
Merge branch '10.5' into 11.3
2 parents 40f4e41 + d9a186d commit ca4f132

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

ChangeLog-11.3.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 11.3 release series are documented in this fi
44

55
## [11.3.6] - 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
@@ -28,6 +28,7 @@
2828
use function array_keys;
2929
use function array_values;
3030
use function debug_backtrace;
31+
use function defined;
3132
use function error_reporting;
3233
use function restore_error_handler;
3334
use function set_error_handler;
@@ -85,14 +86,22 @@ public function __invoke(int $errorNumber, string $errorString, string $errorFil
8586
return false;
8687
}
8788

89+
/**
90+
* E_STRICT is deprecated since PHP 8.4.
91+
*
92+
* @see https://github.com/sebastianbergmann/phpunit/issues/5956
93+
*/
94+
if (defined('E_STRICT') && $errorNumber === @E_STRICT) {
95+
$errorNumber = E_NOTICE;
96+
}
97+
8898
$test = Event\Code\TestMethodBuilder::fromCallStack();
8999

90100
$ignoredByBaseline = $this->ignoredByBaseline($errorFile, $errorLine, $errorString);
91101
$ignoredByTest = $test->metadata()->isIgnoreDeprecations()->isNotEmpty();
92102

93103
switch ($errorNumber) {
94104
case E_NOTICE:
95-
case E_STRICT:
96105
Event\Facade::emitter()->testTriggeredPhpNotice(
97106
$test,
98107
$errorString,

0 commit comments

Comments
 (0)