Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70763 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18140 invoked from network); 19 Dec 2013 21:58:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Dec 2013 21:58:26 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.128.50 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.128.50 mail-qe0-f50.google.com Received: from [209.85.128.50] ([209.85.128.50:64734] helo=mail-qe0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C7/6C-42949-10C63B25 for ; Thu, 19 Dec 2013 16:58:26 -0500 Received: by mail-qe0-f50.google.com with SMTP id 1so1624565qec.37 for ; Thu, 19 Dec 2013 13:58:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=SYeMjByWWrMdOGEyowzCu5ejgLlKMcAGiqmtl60dXlk=; b=FHsQ5cept8InYoSqldcjz2sGZDTZDJ37L+dJ8ltwSYHJC8DIXhLbuJj9fEFAHsDt/N kMRKCQKt4ZrO3PtDIYYZtUUOnEE2mtdbGPP/MiyNh9Uqd+rUPYUXdJXdNtZhzlu5/Njw MEavWZwPpc/CO4oDvxbs2ed1d+QQaQt82xbRd+MwwDmgIH1i9OqHE1KfLeof04wqBgNf tR66jV0Z07RUDBD1g0KaXM9r/iCXGeunlPfN0aU0s0XS6VXF4yIGCpV+Cdukl+4hxtoZ m2qWGZeipipURzEllrAywhhn1++YAYg7ZrYOzjCwa5Qutjvjg8qMSePwHE81W+PEbP7d ulMA== X-Gm-Message-State: ALoCoQmKlNskrguMyKyeKf5ADRiXHGZ0yWZeJYeESiLbjvwRxrp0VLA4DWsuFR+UX2DlmH1R2RJW X-Received: by 10.49.19.40 with SMTP id b8mr7787607qee.8.1387490303236; Thu, 19 Dec 2013 13:58:23 -0800 (PST) Received: from [10.252.8.240] ([64.124.192.210]) by mx.google.com with ESMTPSA id f12sm2841701qaa.18.2013.12.19.13.58.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Dec 2013 13:58:22 -0800 (PST) Message-ID: <52B36BFC.4080708@lerdorf.com> Date: Thu, 19 Dec 2013 16:58:20 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Kris Craig , Daniel Lowrey CC: "internals@lists.php.net" References: In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: power operator (again) From: rasmus@lerdorf.com (Rasmus Lerdorf) On 12/19/2013 04:50 PM, Kris Craig wrote: > I believe that, especially for a KISS language like PHP, our top priority > with math operators should be to match arithmetic laws as closely and as > intuitively as possible. The average PHP developer is going to do -3 ** 2 > and expect a result of 9, not -9, and rightly so I think. No, the average PHP developer is going to do $var ** 2 and it will behave exactly as they expect with negative values. Yes, in the very rare case that someone for some reason hardcodes a negative literal there, they are going to have to learn about operator precedence because we really can't have 0 - 3**2 be different from - 3**2. -Rasmus