Re: [RFC] Generalize support of negative string offsets
| From: | François Laupretre | Date: | Wed, 10 Feb 2016 14:34:07 +0000 |
| Subject: | Re: [RFC] Generalize support of negative string offsets | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-91182@lists.php.net to get a copy of this message | ||
Hi,
I just added support for '[]' on strings and '{}' to the PR.
Examples :
$string[] = 'a'; // equivalent to : $string[strlen($string)]
$string{} = 'a'; // For consistency
With this change, AFAIK, '{}' and '[]' notations are handled exactly the same way (the only difference was that the content inside curly braces was not optional).
This is not strictly in the scope of negative offsets. So, if you think it must be part of a separate RFC, I will remove it.
Thoughts ?
Regards
François