diff --git a/tests/Internal/Codebase/InternalCallMapHandlerTest.php b/tests/Internal/Codebase/InternalCallMapHandlerTest.php index e5f6320fba5..52a17d4b79d 100644 --- a/tests/Internal/Codebase/InternalCallMapHandlerTest.php +++ b/tests/Internal/Codebase/InternalCallMapHandlerTest.php @@ -45,6 +45,7 @@ use const PHP_MAJOR_VERSION; use const PHP_MINOR_VERSION; use const PHP_VERSION; +use const PHP_VERSION_ID; /** @group callmap */ class InternalCallMapHandlerTest extends TestCase @@ -519,7 +520,11 @@ private function getReflectionFunction(string $functionName): ?ReflectionFunctio { try { if (strpos($functionName, '::') !== false) { - return new ReflectionMethod($functionName); + if (PHP_VERSION_ID < 803000) { + [$className, , $methodName] = explode(':', $functionName, 3); + return new ReflectionMethod($className, $methodName); + } + return ReflectionMethod::createFromMethodName($functionName); } /** @var callable-string $functionName */