Re: [RFC] Convert numeric keys in object/array casts
| From: | Yasuo Ohgaki | Date: | Sat, 22 Oct 2016 19:59:38 +0000 |
| Subject: | Re: [RFC] Convert numeric keys in object/array casts | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-96548@lists.php.net to get a copy of this message | ||
Hi Andrea,
On Sat, Oct 22, 2016 at 8:11 AM, Andrea Faulds <ajf@ajf.me> wrote:
> To try and fix a longstanding issue, and to actually bring some attention to
> the fix, I've created a new RFC, which can be found here:
>
>
> https://wiki.php.net/rfc/convert_numeric_keys_in_object_array_casts
>
> It targets PHP 7.2, which is maybe a little conservative. It could target
> PHP 7.1 theoretically, but it's probably a bit late for that.
>
> I'm also not sure if this really ought to be an RFC, but I've received
> little feedback so far, so it can't hurt.
Nice RFC!
It seems patch is made to convert int index to string index to allow
numeric key, is it? I guess it is the limitation and the reason why
it's inaccessible.
Numeric key name must be string?
$obj->{'0'} = 1;
or could be like (Without quotes)
$obj->{0} = 1;
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net