Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56597 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74422 invoked from network); 24 Nov 2011 21:54:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Nov 2011 21:54:27 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.170 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.213.170 mail-yx0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:56830] helo=mail-yx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B4/38-26290-21DBECE4 for ; Thu, 24 Nov 2011 16:54:26 -0500 Received: by yenm10 with SMTP id m10so1049499yen.29 for ; Thu, 24 Nov 2011 13:54:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=1CrQoVGDenFRpig21z1ABDo0Q4PuR2R9SbGWlnSiV8s=; b=lWClOYSd41c3IjP451eX9n/u2dzBvuNyP9NPHociqlUgkFbB7OGsOBM2qOTOQnLu2S vq44swBPmcdb5QdI9u5JBe2CBrPxNU2+L1khblrlbn77ISthT67r1EuFK+BR65fclTJT Kr4SDvjUpbQHfLKTJT1YLfKwY8wM7RoT27eBQ= Received: by 10.236.76.136 with SMTP id b8mr45346743yhe.9.1322171663505; Thu, 24 Nov 2011 13:54:23 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.100.127.18 with HTTP; Thu, 24 Nov 2011 13:53:42 -0800 (PST) In-Reply-To: <4ECEBBB8.90604@lerdorf.com> References: <20111123015008.GA12933@panix.com> <4ECEBBB8.90604@lerdorf.com> Date: Fri, 25 Nov 2011 06:53:42 +0900 X-Google-Sender-Auth: GcONmFTsbuDb4iwIzKiLqaf98kY Message-ID: To: Rasmus Lerdorf Cc: RQuadling@gmail.com, Daniel Convissor , PHP Internals List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] 5.4 regression: non-existent sub-sub keys now have values From: yohgaki@ohgaki.net (Yasuo Ohgaki) 2011/11/25 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 =3D "abc"; var_dump($s[0]["bar"]);' >> PHP Fatal error: =A0Cannot use string offset as an array in Command line >> 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. How about enable notice only for PHP 5.4? Programmer should check vars to see if it's an array, but finding the cause of misbehavior without errors is pain for users. I don't think we have to remove this feature, but it would be nice to raise notice error for a while. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net