Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70253 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80921 invoked from network); 20 Nov 2013 22:02:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Nov 2013 22:02:50 -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.54 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.54 mail-la0-f54.google.com Received: from [209.85.215.54] ([209.85.215.54:63679] helo=mail-la0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 64/25-51208-8813D825 for ; Wed, 20 Nov 2013 17:02:49 -0500 Received: by mail-la0-f54.google.com with SMTP id ev20so7713645lab.41 for ; Wed, 20 Nov 2013 14:02:46 -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=x1FWVjPlVqUM0HS4IzHPY/zLeF7al2vLGFzrnvda8vM=; b=YJggOoBWDnGZ3342Jum3a6caKsmgDoSebYvCCoGFxrzb+kjt1iRhZfjYxwTeixZyYA tOKYKHASSIoNqh4rkJtKpAdpYC+UPmszAlUwARwe5ZLBu5f8cZi3TAf9PHHE/ewh0fp0 hTNtWLRJg4QK1toDbZj5bYO8EhOvlOfhKpdc2guQ3kwKq02OGvOUA4dD+66vHO/jZoXu 5y1OOVrbyY7kbLPUnwTfiKBWpMQhyvgKr2zAUyDVikJWMx8bCpM942MMfhAmo41P+CSe JLHa/cWgcv/AfdFPQaHNGusElehcHKdfpsKkzI9w+ePiePWUr1WhsJ2oa4epmTEIXwX3 1UMg== X-Received: by 10.112.147.8 with SMTP id tg8mr10288lbb.94.1384984965958; Wed, 20 Nov 2013 14:02:45 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.154.201 with HTTP; Wed, 20 Nov 2013 14:02:05 -0800 (PST) In-Reply-To: <528D2F4D.6050003@ajf.me> References: <528D2E66.7090009@ajf.me> <528D2F4D.6050003@ajf.me> Date: Thu, 21 Nov 2013 07:02:05 +0900 X-Google-Sender-Auth: OePZ5JW9cEDYfRsPms_EfvThG9M Message-ID: To: Andrea Faulds Cc: Nikita Popov , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=047d7b3a85caea52f304eba2f0b8 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) --047d7b3a85caea52f304eba2f0b8 Content-Type: text/plain; charset=UTF-8 Hi Andrea, On Thu, Nov 21, 2013 at 6:53 AM, Andrea Faulds wrote: > On 20/11/13 21:49, Andrea Faulds wrote: > >> >> Just my 2 cents, but that definitely looks like a situation that might >> crop up in real code unintentionally, and it violates the Principle of >> Least Astonishment IMO. Consider a hypothetical function which returns a >> modified string. If we've ended up with an empty string being passed >> into it, then it suddenly returning an Array is not what you expect, and >> might horribly break code that assumes the result won't be a string. >> >> > Oh dear Andrea, you should proofread your emails better. > s/won't be/will be I agree with your discussion and that's the reason why I sending this PR before I said "it's the spec". I've added this behavior to RFC (NOT for voting) https://wiki.php.net/rfc/comparison_inconsistency?&#conversioncomparison I'm gathering these kind of PHP behaviors. If you have one, please let me know so that I can add issues in the wiki page. (Or even better, please add one to the page) Thank you. -- Yasuo Ohgaki yohgaki@ohgaki.net --047d7b3a85caea52f304eba2f0b8--