Fix #13805: phpstan does not recognize keys after array literal merge correctly by phpstan-bot · Pull Request #4897 · phpstan/phpstan-src
and others added 2 commits
February 12, 2026 14:31…ray literals - Track HasOffsetValueType accessories when spreading constant arrays with string keys in InitializerExprTypeResolver::getArrayType() - When the array builder degrades to a general array (e.g. due to a non-constant spread), intersect the result with HasOffsetValueType for keys from constant array spreads that appear later - Properly invalidate tracked offsets when a subsequent non-constant spread could overwrite them - New regression test in tests/PHPStan/Analyser/nsrt/bug-13805.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters