You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Nullsafe fetch on a non-null property receiver is typed nullable since 7.7.0 #13936
What Psalm reports / does
Trace: $_r is bool|null. $h->item is a non-null Item (Psalm itself reports RedundantCondition: Type Item for $h->item is never null), so ?-> never short-circuits and the null branch is dead. Psalm 7.6.0 gives bool.
Since 7.7.0, NullsafeAnalyzer takes the receiver type of a property-fetch receiver from $context->vars_in_scope; a property fetch that was not read before is absent there, so $var_type is null and the non-null fast path is skipped.
What you expected $_r is bool, as on 7.6.0.
Psalm version, PHP version
psalm.dev 7.x-dev, PHP default; also 7.7.0 locally (7.6.0 is correct)
Activity
psalm-github-bot commentedon Nov 16, 2026
I found these snippets:
https://psalm.dev/r/baae6a6cd3
Require Psalm 7.7 (#2312)
test(nullsafe): cover double chains and magic property receivers vime…
test(nullsafe): guard a nullsafe fetch on a property of a nullable ho…
fix(nullsafe): type a nullsafe fetch on an unread non-null property r…
Narrow `non-empty-string` to `non-falsy-string` in `Collection::filte…