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

From: Date: Thu, 24 Nov 2011 10:48:45 +0000
Subject: Re: 5.4 regression: non-existent sub-sub keys now have values
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  Groups: php.internals 
Request: Send a blank email to internals+get-56568@lists.php.net to get a copy of this message
Just a quick note for this issue. If I remember correctly, PHP is working this way at least from PHP 3.0.x. $a[123] // integer index $a['123'] // integer index $a['123 abc'] // string index $a['123.123'] // string index Automatic string to integer conversion only happened if index string has numeric chars. It seems some people are confused. isset($a[0][0]) became true if and only if $a is string. If there is a code broken by this behavior, it would be enough for add is_array() if (is_array($a) && isset($a[0][0])) I suppose. -- Yasuo Ohgaki yohgaki@ohgaki.net

« previous php.internals (#56568) next »