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
array shape is not honored when combined with string literals #11006
Yes, using $productParentPayloadDto->SizeAttributeCode as an array key downgrades the array shape to a regular array. Otherwise we'd have to split and maintain multiple array shapes from that point on. It's possible but that's not what PHPStan currently does.
Activity
ondrejmirtes commentedon May 14, 2024
Yes, using
$productParentPayloadDto->SizeAttributeCodeas an array key downgrades the array shape to a regular array. Otherwise we'd have to split and maintain multiple array shapes from that point on. It's possible but that's not what PHPStan currently does.phpstan-bot commentedon Nov 1, 2025
@Harrald After the latest push in 2.1.x, PHPStan now reports different result with your code snippet:
Full report
PHP 8.5 (2 errors)
PHP 8.0 – 8.4 (1 error)
PHP 7.2 – 7.4 (6 errors)
Promoted properties are supported only on PHP 8.0 and later.Promoted properties are supported only on PHP 8.0 and later.Promoted properties are supported only on PHP 8.0 and later.Promoted properties are supported only on PHP 8.0 and later.Named arguments are supported only on PHP 8.0 and later.Add regression tests for related issues fixed by constant array shape…
phpstan-bot commentedon Mar 14, 2026
Closed via merging phpstan/phpstan-src#5193
github-actions commentedon Apr 15, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.