On Fri, 15 Mar 2019 at 17:53, Levi Morrison <le...@php.net> wrote:

>   1. I cannot think of *any* reason to separate them. If you want to
> make sure you are indexing a string, *do a type check*, not bake `{}`
> into only working on strings.
>


I think it's more common to do the opposite: think you're working on an
array, and accidentally pick up a string.

If we separated the syntaxes, it would be possible to always raise a
warning when that happens, rather than silently returning the Nth character.

To be honest I can't remember the last time I used *either* syntax for
string access, other than by accident.

Regards,
-- 
Rowan Collins
[IMSoP]

Reply via email to