diff --git a/src/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php b/src/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php index df62239ea..84758ef6d 100644 --- a/src/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php +++ b/src/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php @@ -237,7 +237,7 @@ class FunctionDocblockManipulator continue; } - if ($char === '\\' || preg_match('/\w/', $char)) { + if ($chars[$i + 1] === '\\' || preg_match('/\w/', $char)) { if ($this->return_typehint_start === null) { $this->return_typehint_start = $i + $end_bracket_position + 1; }