Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56489 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74606 invoked from network); 23 Nov 2011 09:26:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Nov 2011 09:26:52 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.203 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.203 smtp203.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.203] ([67.192.241.203:41390] helo=smtp203.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DB/84-45113-A5CBCCE4 for ; Wed, 23 Nov 2011 04:26:51 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp20.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id E575E258113; Wed, 23 Nov 2011 04:26:46 -0500 (EST) X-Virus-Scanned: OK Received: by smtp20.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id A8312258143; Wed, 23 Nov 2011 04:26:46 -0500 (EST) Message-ID: <4ECCBC56.3050602@sugarcrm.com> Date: Wed, 23 Nov 2011 01:26:46 -0800 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Lester Caine CC: PHP internals References: <20111123015008.GA12933@panix.com> <20111123023108.GA172@panix.com> <4ECCB549.904@lsces.co.uk> In-Reply-To: <4ECCB549.904@lsces.co.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] 5.4 regression: non-existent sub-sub keys now have values From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! On 11/23/11 12:56 AM, Lester Caine wrote: > > I'm having a lot of trouble with working out WHAT is going on here at all. It's actually very simple. Take variable $a which is a string ("foo"). Now it you do $a[0] that would produce first letter - "f". Now here's a tricky part - if you do $a['blah'] it would convert 'blah' to number, get 0 and return the same letter "f". Now what happens if you do $a[0][0]? Since $a[0] is "f", $a[0][0] should be first letter of "f" which is "f" again, right? Only in 5.3 it did not work because of some deficiencies in implementation of string offsets. In 5.4 it was fixed. Now the situation in the bug - what happens if we do $a['blah']['foobar']? As we noted before, it's the same as $a[0][0] and thus produces "f" in 5.4. In 5.3 it didn't work because of the above deficiency. That's it. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227