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
Psalm output (using commit 0257752):
ERROR: UndefinedGlobalVariable - 5:24 - Cannot find referenced variable $timestamp in global scope
ERROR: InvalidArrayOffset - 3:1 - Cannot create offset of type false|int, expecting array-key
INFO: UnusedVariable - 4:5 - $timestamp is never referenced or the value is not used
INFO: UnusedVariable - 7:5 - $timestamp is never referenced or the value is not used
INFO: UnusedVariable - 10:5 - $timestamp is never referenced or the value is not used
the bug is caused by evaluation order — currently all keys are evaluated first, which is wrong. It should be possible instead to do it by key and value
Definitely agree the code is not perfect though it's still valid or is it not?
Stumbled upon it in legacy code base where there's complex array structure in tests and the lowest level array is constructed like this. Hard to squeeze foreach inside. I would have to wrap it in a function, call it and unpack ... or sth like that.
Activity
psalm-github-bot commentedon Jul 8, 2021
I found these snippets:
https://psalm.dev/r/d4185292b9
muglug commentedon Jul 9, 2021
Few comments:
psalm-github-bot commentedon Jul 9, 2021
I found these snippets:
https://psalm.dev/r/366293c0e1
simPod commentedon Jul 12, 2021
Definitely agree the code is not perfect though it's still valid or is it not?
Stumbled upon it in legacy code base where there's complex array structure in tests and the lowest level array is constructed like this. Hard to squeeze foreach inside. I would have to wrap it in a function, call it and unpack
...
or sth like that.->
Fix #6061 — delay analysis of array value except when unpacking