> > >> > Isn't it better to raise notice for accessing string by string index? >> > There is no use to allowing string index access to strings. I think >> > raising notice is feasible. Isn't it? >> >> String index access is still required since they are often numeric >> strings. We could add a notice for non-numeric strings, but the check >> would slow things down a bit. > > > yeah, as I mentioned before: > "The other improvement (related but not introduced in this change) that I > suggested was that we could also trigger a notice when a "non-applicable" > string offset is passed(defining non-applicable is a little bit hard, > because of the current type-juggling rules, we have to allow $string["1"], > because '1" can come from a database, or get/post, where it would be a > string, not an int, but if we go with the current type juggling, > $string["2_foo_3"] would also be converted to $string[2], which isn't > really intended imo. ." > > I would vote for allowing only numbers in the string index/offset: [0-9]+ >
By "allowing" I meant that we should trigger the notice if the string index contains anything else than numbers. -- Ferenc Kovács @Tyr43l - http://tyrael.hu