Re: 5.4 regression: non-existent sub-sub keys now have values
| From: | Pierre Joye | Date: | Wed, 23 Nov 2011 18:22:50 +0000 |
| Subject: | Re: 5.4 regression: non-existent sub-sub keys now have values | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-56519@lists.php.net to get a copy of this message | ||
On Wed, Nov 23, 2011 at 6:58 PM, Richard Quadling <rquadling@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