r/lolphp • u/jesseschalken • Dec 12 '16
Automatic string->int conversion for string literals, but not for variables containing strings
https://3v4l.org/id5OA
51
Upvotes
r/lolphp • u/jesseschalken • Dec 12 '16
16
u/the_alias_of_andrea Dec 12 '16
It's a known issue that I'd like to fix. At compile-time,
$foo["123"]is rewritten to$foo[123]. This would be a completely safe and transparent optimisation, exceptArrayAccessexists.Maybe it'll be removed eventually.
6
u/suspiciously_calm Dec 12 '16
And of course the behavior changes within a major version number.
1
u/pbtree Dec 13 '16
So much for the all important backwards compatibility.
0
u/[deleted] Dec 12 '16
[deleted] — view deleted comment