Re: 5.4 regression: non-existent sub-sub keys now have values

From: Date: Wed, 23 Nov 2011 19:25:33 +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-56527@lists.php.net to get a copy of this message
Hi!
The only case where the 5.4 branch works differently as before if you reference a string type(int, float, etc. won't trigger this) variable using an associative index and you expect it that to be undefined variable even though that the documentation explicitly states that the
Actually, the only change 5.4 did was to make $a['foo']['bar'] work like ($a['foo'])['bar'] - i.e. chained offsets work the same way as if they were applied separately. That's it. All the rest has been there since forever. I can't see how one could argue it should stay this way. Now I'm sorry somebody used the fact that chained offsets didn't work to do a check "do we have any strings there" but that's not how PHP is supposed to work and it's clearly a side-effect of a bug. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227

« previous php.internals (#56527) next »