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
Commit 77527df
Browse filesBrowse the repository at this point in the historyBrowse files
Narrow falsey isset() on an optional constant-array offset
!isset($a['k']) where 'k' is an optional key with a non-nullable value
type implies the key is absent, so remove HasOffsetType('k') from the
subject - the counterpart of the removal already done for keys that
surely exist, and of the falsey array_key_exists() narrowing. The
removal is skipped when any union member can hold null at the offset
(there the key may exist with a null value).
With the falsey branch actually narrowed, branch merges see differing
types for the subject and the conditional-expression guard machinery
picks it up, so variables assigned under if (isset($a['k'])) regain
their certainty when the same isset() is re-checked later.
The `??=` value scope (which already applied this helper) now unsets
the target offset, and a sealed all-optional shape intersected with
non-empty-array collapses to its only possible key - the updated
bug-15021 and isset-constant-array expectations record both, each
strictly more precise than before.
Closesphpstan/phpstan#9426
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CGhnJQpUWRRpg6H5LuWJkA
0 commit comments