Hi, What people seem to have trouble with here is not that $string[0][0] == $string[0], but rather that $string['index'] === $string[0]...
But as many people said, it is just how type juggling want: string index? Get me an int => 0. I believe the change introduced in 5.4 makes sense, the previous way it worked made no sense and was simply an anomaly. It is clear from this thread that the confusion comes from strings as string offsets, something "totally" different, but changing that would be a much bigger BC break I guess. Best, On Wed, Nov 23, 2011 at 19:22, Pierre Joye <pierre....@gmail.com> wrote: > On Wed, Nov 23, 2011 at 6:58 PM, Richard Quadling <rquadl...@gmail.com> wrote: > >> Just looking for any test relating to isset() to see what tests will now >> fail. >> >> Neither of the isset() tests ext/standard/tests/general_functions look >> at arrays with associative indices. >> >> The behaviour with regard to unavailable associative indices has no tests. >> >> But using loose typing as a fallback for non existent keys seems >> really really wrong. >> >> Especially if the key is a constant. On what planet should ... >> >> isset($arr['exists']['test_existance']) should become >> isset($arr['exists'][0]) >> >> That just seems really wrong and the work around is awful. > > That's exactly why I stoped to use this syntax a long time ago. And I > was in favor to deprecate it and actually remove it the next major > release (6 that is). But that's another discussion. > > Unless I'm mistaken it seems that we have a clear and vicious BC break > here, the kind of changes that are annoying to catch and does not > bring a lot of benefits to PHP (given the actual usage of this > syntax). I would go with a revert, add tests and never change this > behavior again. It is a confusing enough topic. > > Cheers, > -- > Pierre > > @pierrejoye | http://blog.thepimp.net | http://www.libgd.org > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Etienne Kneuss http://www.colder.ch -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php