From 203d2c2b3de090e4049459d2395f23097c4923ad Mon Sep 17 00:00:00 2001 From: orklah Date: Thu, 24 Nov 2022 19:17:23 +0100 Subject: [PATCH] Fix #8747 --- src/Psalm/Internal/Type/TypeParser.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Psalm/Internal/Type/TypeParser.php b/src/Psalm/Internal/Type/TypeParser.php index 214d89df94b..cce99c5e0f0 100644 --- a/src/Psalm/Internal/Type/TypeParser.php +++ b/src/Psalm/Internal/Type/TypeParser.php @@ -90,7 +90,6 @@ use function preg_match; use function preg_replace; use function reset; -use function str_starts_with; use function stripslashes; use function strlen; use function strpos; @@ -1472,7 +1471,7 @@ private static function getTypeFromKeyedArrayTree( return new TObjectWithProperties($properties, [], [], $from_docblock); } - $callable = str_starts_with($type, 'callable-'); + $callable = strpos($type, 'callable-') === 0; $class = TKeyedArray::class; if ($callable) { $class = TCallableKeyedArray::class;