Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70753 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71936 invoked from network); 19 Dec 2013 18:08:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Dec 2013 18:08:53 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 198.187.29.247 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 198.187.29.247 imap4-3.ox.registrar-servers.com Received: from [198.187.29.247] ([198.187.29.247:60165] helo=imap4-3.ox.registrar-servers.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AC/33-42949-23633B25 for ; Thu, 19 Dec 2013 13:08:51 -0500 Received: from localhost (localhost [127.0.0.1]) by oxmail.registrar-servers.com (Postfix) with ESMTP id B646B560082; Thu, 19 Dec 2013 13:08:47 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap4.ox.registrar-servers.com Received: from oxmail.registrar-servers.com ([127.0.0.1]) by localhost (imap4.ox.registrar-servers.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id g5uitxrUjHGq; Thu, 19 Dec 2013 13:08:47 -0500 (EST) Received: from [192.168.0.13] (unknown [94.13.99.191]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by oxmail.registrar-servers.com (Postfix) with ESMTPSA id 2F6CC56007E; Thu, 19 Dec 2013 13:08:46 -0500 (EST) Message-ID: <52B3362C.80108@ajf.me> Date: Thu, 19 Dec 2013 18:08:44 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Levi Morrison , Tjerk Meesters CC: Kris Craig , PHP Internals References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: [vote] pow-operator From: ajf@ajf.me (Andrea Faulds) On 19/12/13 02:38, Levi Morrison wrote: >> >>>> That said, if there are other reasons for voting 'no' besides >>>> associativity, feel free to shoot me an email or discuss it on the list. >>> >>> What did it for me was the lower precedence for the unary minus. I don't >>> want to have another language that thinks a negative number squared is a >>> negative number. I understand and respect your reasoning as outlined in >>> the RFC, but this is a deal-breaker for me. >> >> I've had a short discussion with Anthony about this and he convinced me >> that I was indeed wrong about my "unary minus" reasoning; therefore I have >> updated the RFC to reflect that. So: >> >> echo -3 ** 2; // 9 >> echo 1 - 3 ** 2; // -8 >> >> The unary minus is now at the same level as `[`, the array dereferencing >> operator. >> > > We should follow the mathematic precedence rules; -3 ** 2 should be -9. > > Note that "-3^2" as input to Mathematica, Matlab and Google search engine > all gave -9 as the answer, *as mathematically expected*. > It would be quite strange if we treated "0 - 3 ^ 2" and "- 3 ^ 2" differently. They should be identical! -- Andrea Faulds http://ajf.me/