diff --git a/tests/Traits/InvalidCodeAnalysisTestTrait.php b/tests/Traits/InvalidCodeAnalysisTestTrait.php index b837c40a0e2..8447e605eb7 100644 --- a/tests/Traits/InvalidCodeAnalysisTestTrait.php +++ b/tests/Traits/InvalidCodeAnalysisTestTrait.php @@ -53,7 +53,7 @@ public function testInvalidCode( ): void { $test_name = $this->getTestName(); if (strpos($test_name, 'PHP80-') !== false) { - if (version_compare(PHP_VERSION, '8.0.0', '<')) { + if (PHP_VERSION_ID < 8_00_00) { $this->markTestSkipped('Test case requires PHP 8.0.'); } diff --git a/tests/Traits/ValidCodeAnalysisTestTrait.php b/tests/Traits/ValidCodeAnalysisTestTrait.php index 370206423a9..a7917f6f841 100644 --- a/tests/Traits/ValidCodeAnalysisTestTrait.php +++ b/tests/Traits/ValidCodeAnalysisTestTrait.php @@ -44,7 +44,7 @@ public function testValidCode( ): void { $test_name = $this->getTestName(); if (strpos($test_name, 'PHP80-') !== false) { - if (version_compare(PHP_VERSION, '8.0.0', '<')) { + if (PHP_VERSION_ID < 8_00_00) { $this->markTestSkipped('Test case requires PHP 8.0.'); } @@ -52,7 +52,7 @@ public function testValidCode( $php_version = '8.0'; } } elseif (strpos($test_name, 'PHP81-') !== false) { - if (version_compare(PHP_VERSION, '8.1.0', '<')) { + if (PHP_VERSION_ID < 8_01_00) { $this->markTestSkipped('Test case requires PHP 8.1.'); }