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
Control symbols in array shape keys definition incorrectly inferred by psalm #11573
I'm not sure if it's me who did something wrong or if it's wrong Psalm behavior, but take a look at the following example - https://psalm.dev/r/dc2c9fe8e7
I have a CSV that contains headers with line breaks, and I can't/don't know how to correctly define the Psalm array shape for the records from that CSV.
From my perspective, it looks like I can't define an array shape key that has line breaks - Psalm just strips the escape symbol (\) from the array shape definition, making it unable to define. I tried to define it with an actual line break, but it seems that Psalm treats it as a space character instead of a line break sequence.
Psalm output (using commit cdceda0):
ERROR: InvalidArrayOffset - 19:27 - Cannot access value on variable $row using offset value of 'some
key1', expecting 'somernkey1', 'somenkey2' or 'some key3'
ERROR: InvalidArrayOffset - 19:42 - Cannot access value on variable $row using offset value of 'some
key2', expecting 'somernkey1', 'somenkey2' or 'some key3'
ERROR: InvalidArrayOffset - 19:57 - Cannot access value on variable $row using offset value of 'some
key3', expecting 'somernkey1', 'somenkey2' or 'some key3'
Activity
psalm-github-bot commentedon Oct 23, 2025
I found these snippets:
https://psalm.dev/r/dc2c9fe8e7
fix(types): quoted keys of an array shape are read as PHP string lite…