Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70249 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74227 invoked from network); 20 Nov 2013 21:38:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Nov 2013 21:38:58 -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.215.49 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.49 mail-la0-f49.google.com Received: from [209.85.215.49] ([209.85.215.49:38915] helo=mail-la0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2D/A3-51208-0FB2D825 for ; Wed, 20 Nov 2013 16:38:57 -0500 Received: by mail-la0-f49.google.com with SMTP id er20so7629310lab.8 for ; Wed, 20 Nov 2013 13:38:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=gqZF0YKkEg4fNsAAc5ridTdyFrehwiAk1j9ZcAnvEf8=; b=SszcKcjcoQctsvBel8OFmECTlqFG+9/bcbM3vENmi9Z4R8nIHzrm4G0dN8k7VTjMz7 ylRf7isPxYzgQFpAlTppR51z7RnZ9wLDp9i/do/6MVBV0VggHSyGXcov/aXt2eby0zpp EzUGwQwhr9C8xIo1uiD4W8r988K85Y8O6Ltxa5kDB/d7QT89P1OOUfFR7ZcAhYNUUKvf 6L/lRzCC3q6CRgcgp6SUfT0sZU0Z+EMQCzJLnF0k09l2F/UslGTR7/Oada316X/KdmjA c7vdmIuI/zOVXpCg2vEgDfL2QpAObohgPNMUMd03QycHxDQOSgrgzyzfiUGBnYIMwn00 xnaw== X-Received: by 10.112.218.39 with SMTP id pd7mr46884lbc.54.1384983533566; Wed, 20 Nov 2013 13:38:53 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.154.201 with HTTP; Wed, 20 Nov 2013 13:38:13 -0800 (PST) In-Reply-To: References: Date: Thu, 21 Nov 2013 06:38:13 +0900 X-Google-Sender-Auth: csZ2PCrM3H8i1j_RZH4jQzgh-1w Message-ID: To: Nikita Popov Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c3cdc889c13104eba29bd4 Subject: Re: [PHP-DEV] fix bug #53432 (Assignment via string index access on an empty string converts to array) From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c3cdc889c13104eba29bd4 Content-Type: text/plain; charset=UTF-8 Hi Nikita, On Thu, Nov 21, 2013 at 12:26 AM, Nikita Popov wrote: > The current behavior is that anything "falsey" (e.g. null, false and the > empty string) is silently cast to array when an array operation is applied > to it. I don't like that behavior, but it's somewhat internally consistent > now. Changing it for strings *only* seems a bit weird. Persuasive argument. I prefer to change the behavior if I have to choose, though. $a = ''; // empty string $a[10] = 'a'; echo $a; // "Array" would be common pit hole when users are trying to use string as array of chars. I don't know why, but there are 436 FB likes! for this PR even if there is no "likes!" button on the page. There may be a lot of users that are unhappy with this behavior. Document and warn users? Or should we change behavior even if it seems odd? I don't mind at all setting up RFC to vote. Any comments? -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c3cdc889c13104eba29bd4--