Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56605 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99665 invoked from network); 25 Nov 2011 00:24:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Nov 2011 00:24:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=devis@oracolo.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=devis@oracolo.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain oracolo.com designates 209.85.161.42 as permitted sender) X-PHP-List-Original-Sender: devis@oracolo.com X-Host-Fingerprint: 209.85.161.42 mail-fx0-f42.google.com Received: from [209.85.161.42] ([209.85.161.42:58416] helo=mail-fx0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 03/20-32517-030EECE4 for ; Thu, 24 Nov 2011 19:24:17 -0500 Received: by faas12 with SMTP id s12so3393823faa.29 for ; Thu, 24 Nov 2011 16:24:13 -0800 (PST) Received: by 10.152.104.167 with SMTP id gf7mr18980292lab.46.1322180653087; Thu, 24 Nov 2011 16:24:13 -0800 (PST) MIME-Version: 1.0 Sender: devis@oracolo.com Received: by 10.152.21.40 with HTTP; Thu, 24 Nov 2011 16:23:32 -0800 (PST) In-Reply-To: <4ECEBBB8.90604@lerdorf.com> References: <20111123015008.GA12933@panix.com> <4ECEBBB8.90604@lerdorf.com> Date: Fri, 25 Nov 2011 00:23:32 +0000 X-Google-Sender-Auth: dnUPRZGwnqhZDac4fKcAgaU3jys Message-ID: To: Rasmus Lerdorf Cc: Yasuo Ohgaki , RQuadling@gmail.com, Daniel Convissor , PHP Internals List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] 5.4 regression: non-existent sub-sub keys now have values From: devis@lucato.it On 24 November 2011 21:48, Rasmus Lerdorf wrote: > 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 =3D "abc"; var_dump($s[0]["bar"]);' >> PHP Fatal error: =C2=A0Cannot use string offset as an array in Command l= ine >> code on line 1 >> >> PHP 5.4 >> ./php -r '$s =3D "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 > Would it be possible to have that check only if E_NOTICE is enabled ? That would allow to limit the cost to development environments (assuming one could disable E_NOTICEs on production env). Devis