Re: ArrayAccess: Constant numeric string offsets become integers
| From: | Sara Golemon | Date: | Sat, 08 Jul 2017 04:21:21 +0000 |
| Subject: | Re: ArrayAccess: Constant numeric string offsets become integers | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-99820@lists.php.net to get a copy of this message | ||
On Fri, Jul 7, 2017 at 7:30 PM, Rudi Theunissen <rtheunissen@php.net> wrote:
> Bug: https://bugs.php.net/bug.php?id=63217
> PR: https://github.com/php/php-src/pull/2607
> Demo: https://3v4l.org/dagUP
>
> We should either go full array behaviour, or full array syntax only. The
> numeric string optimisation that causes this bug is broken and should
> either be fixed or removed entirely.
>
Agreed. offsetGet() et al should either normalize to keyish values,
or do no normalization at all. The current PHP behavior is a
half-measure and incorrect by any measure. I like HHVM's behavior
here as it gives more power to the script dev.
-Sara