Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56594 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69987 invoked from network); 24 Nov 2011 21:48:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Nov 2011 21:48:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.210.170 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.210.170 mail-iy0-f170.google.com Received: from [209.85.210.170] ([209.85.210.170:48280] helo=mail-iy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D3/47-26290-DBBBECE4 for ; Thu, 24 Nov 2011 16:48:45 -0500 Received: by iakc1 with SMTP id c1so3897496iak.29 for ; Thu, 24 Nov 2011 13:48:43 -0800 (PST) Received: by 10.42.136.196 with SMTP id v4mr9313792ict.3.1322171323033; Thu, 24 Nov 2011 13:48:43 -0800 (PST) Received: from [192.168.200.5] (c-50-131-44-225.hsd1.ca.comcast.net. [50.131.44.225]) by mx.google.com with ESMTPS id g16sm92107522ibs.8.2011.11.24.13.48.41 (version=SSLv3 cipher=OTHER); Thu, 24 Nov 2011 13:48:41 -0800 (PST) Message-ID: <4ECEBBB8.90604@lerdorf.com> Date: Thu, 24 Nov 2011 13:48:40 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Yasuo Ohgaki CC: RQuadling@gmail.com, Daniel Convissor , PHP Internals List References: <20111123015008.GA12933@panix.com> In-Reply-To: X-Enigmail-Version: 1.4a1pre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] 5.4 regression: non-existent sub-sub keys now have values From: rasmus@lerdorf.com (Rasmus Lerdorf) On 11/24/2011 01:44 PM, Yasuo Ohgaki wrote: > Hi all, > > I should think twice before seding mail. "abc" as array index is > converted to 0 since it's not a integer. So with current code is > behave consistently with regards to string to long conversion. > > However, > > PHP 5.3 > php -r '$s = "abc"; var_dump($s[0]["bar"]);' > PHP Fatal error: Cannot use string offset as an array in Command line > code on line 1 > > PHP 5.4 > ./php -r '$s = "abc"; var_dump($s[0]["bar"]);' > string(1) "a" > > Isn't it better to raise notice for accessing string by string index? > There is no use to allowing string index access to strings. I think > raising notice is feasible. Isn't it? String index access is still required since they are often numeric strings. We could add a notice for non-numeric strings, but the check would slow things down a bit. -Rasmus