diff --git a/tests/system/Debug/TimerTest.php b/tests/system/Debug/TimerTest.php index d99d877fc84a..54c9fdfccb18 100644 --- a/tests/system/Debug/TimerTest.php +++ b/tests/system/Debug/TimerTest.php @@ -172,7 +172,7 @@ public function testRecordThrowsException(): void public function testRecordThrowsErrorOnCallableWithParams(): void { - if (version_compare(PHP_VERSION, '8.0.0') >= 0) { + if (PHP_VERSION_ID >= 80000) { $this->expectException(ArgumentCountError::class); } else { $this->expectException(ErrorException::class); diff --git a/tests/system/Helpers/ArrayHelperTest.php b/tests/system/Helpers/ArrayHelperTest.php index 9a91c807c4b4..4844fe84188e 100644 --- a/tests/system/Helpers/ArrayHelperTest.php +++ b/tests/system/Helpers/ArrayHelperTest.php @@ -304,10 +304,10 @@ public function testArraySortByMultipleKeysFailsEmptyParameter(array $data, arra public function testArraySortByMultipleKeysFailsInconsistentArraySizes($data): void { // PHP 8 changes this error type - if (version_compare(PHP_VERSION, '8.0', '<')) { - $this->expectException(ErrorException::class); - } else { + if (PHP_VERSION_ID >= 80000) { $this->expectException(ValueError::class); + } else { + $this->expectException(ErrorException::class); } $this->expectExceptionMessage('Array sizes are inconsistent');