Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56504 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16789 invoked from network); 23 Nov 2011 14:14:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Nov 2011 14:14:13 -0000 Authentication-Results: pb1.pair.com header.from=danielc@analysisandsolutions.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=danielc@analysisandsolutions.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain analysisandsolutions.com from 166.84.1.89 cause and error) X-PHP-List-Original-Sender: danielc@analysisandsolutions.com X-Host-Fingerprint: 166.84.1.89 mailbackend.panix.com Solaris 10 (beta) Received: from [166.84.1.89] ([166.84.1.89:46807] helo=mailbackend.panix.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8F/A2-31179-3BFFCCE4 for ; Wed, 23 Nov 2011 09:14:12 -0500 Received: from panix5.panix.com (panix5.panix.com [166.84.1.5]) by mailbackend.panix.com (Postfix) with ESMTP id 6540B28EE1; Wed, 23 Nov 2011 09:14:09 -0500 (EST) Received: by panix5.panix.com (Postfix, from userid 14662) id 2ABBB24249; Wed, 23 Nov 2011 09:14:09 -0500 (EST) Date: Wed, 23 Nov 2011 09:14:09 -0500 To: Stas Malyshev Cc: Lester Caine , PHP internals Message-ID: <20111123141408.GA11940@panix.com> References: <20111123015008.GA12933@panix.com> <20111123023108.GA172@panix.com> <4ECCB549.904@lsces.co.uk> <4ECCBC56.3050602@sugarcrm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4ECCBC56.3050602@sugarcrm.com> User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: [PHP-DEV] 5.4 regression: non-existent sub-sub keys now have values From: danielc@analysisandsolutions.com (Daniel Convissor) Hi Stas: > 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". To me, this is the bug. $a['blah'] does not exist. An undefined index notice should be raised. The key "blah" should not be converted to 0. The following two things should behave the same: $b = array('exists' => 'foo'); echo $b['blah'] . "\n"; $a = 'foo'; echo $a['blah'] . "\n"; But that second one echos out "f". This is a huge WTF. Thanks, --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409