Skip to content

Commit f7a4c90

Browse files
committed
fi
1 parent 82fbc45 commit f7a4c90

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/Analyser/ExprHandler/Helper/ImplicitToStringCallHelper.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ public function processImplicitToStringCall(Expr $expr, MutatingScope $scope): E
2828
$impurePoints = [];
2929

3030
$exprType = $scope->getType($expr);
31-
$toStringMethod = $scope->getMethodReflection($exprType, '__toString');
31+
32+
$toStringMethod = null;
33+
if (!$exprType->isObject()->no()) {
34+
$toStringMethod = $scope->getMethodReflection($exprType, '__toString');
35+
}
3236
if ($toStringMethod === null) {
3337
return new ExpressionResult(
3438
$scope,

0 commit comments

Comments
 (0)