Fix ArrayAccess with objects as keys#4496
Conversation
| // array | ||
| if (Template::METHOD_CALL !== $type) { | ||
| $arrayItem = \is_bool($item) || \is_float($item) ? (int) $item : $item = (string) $item; | ||
| $arrayItem = \is_bool($item) || \is_float($item) ? (int) $item : $item; |
There was a problem hiding this comment.
@nicolas-grekas I'm not sure if there was a good reason for the string casting. So maybe it should be done somewhere else? Or is it ok to just remove the casting?
nicolas-grekas
left a comment
There was a problem hiding this comment.
Thanks for the regression test, that's what was missing.
|
Thank you @gharlan. |
|
This change has introduced a separate breaking change: previously if you did I realize that Arrays in PHP can only be indexed by integer or string keys, and the intent of EDIT: created an issue for this: #4701 |
fixes #4476
The bug was introduced in 3.15 via #4425 (comment)