Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70769 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27908 invoked from network); 19 Dec 2013 22:30:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Dec 2013 22:30:42 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.128.42 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.128.42 mail-qe0-f42.google.com Received: from [209.85.128.42] ([209.85.128.42:43702] helo=mail-qe0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BE/7E-42949-09373B25 for ; Thu, 19 Dec 2013 17:30:41 -0500 Received: by mail-qe0-f42.google.com with SMTP id b4so1685829qen.29 for ; Thu, 19 Dec 2013 14:30:38 -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=zEIADmbF6ZqlxJox+ifmd87PBYMsT4DsTXj5CP2ZlkE=; b=UIfMdWZmLcEGUObfG3RQeHdEmLJAd2rHEm1tokq5UBO3g5RQ8XnCeKMMHTWO9WdABJ khfcZ+nHJs5yOLZu8ylH1X+Me9T90Cge/TwLl4ADXOSo+k04BnLDmWjDsqk6r+fY9mrE TLuCkBQsE145b+56ItIjG1aXp6LBeaIdBttQdV/MGAOpGAIBWwnOkYetXyh0caQ6O9kh LT7IW9xHDs22KNUgYcRXmA4xNG0Nw0Ztmvo2c+QnMwAVlrT8v1VBdaNjC6GU6IKVVKsr UQnpq1x1gVSw79PZpSL0EHYiGKXAl58ritddCeTi+kOwCd7/lqm2jiuK97j78iWZ3vI7 4DeQ== X-Gm-Message-State: ALoCoQlHhICiy6QK92VCRo43x0CKMO9Se+ZGU+cBD4r5eeyvmpwt7anUyJmnX9zOPpwiJEgmd7oQ X-Received: by 10.224.128.134 with SMTP id k6mr8028146qas.68.1387492238334; Thu, 19 Dec 2013 14:30:38 -0800 (PST) Received: from [10.252.8.240] ([64.124.192.210]) by mx.google.com with ESMTPSA id f10sm13569534qej.1.2013.12.19.14.30.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Dec 2013 14:30:37 -0800 (PST) Message-ID: <52B3738C.6020902@lerdorf.com> Date: Thu, 19 Dec 2013 17:30:36 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: George Wilson CC: PHP internals References: <52B36BFC.4080708@lerdorf.com> 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 05:11 PM, George Wilson wrote: > Sorry, that was meant to goto the list. > > On Thu, Dec 19, 2013 at 2:09 PM, George Wilson wrote: >> Maybe this is because my educational background is in Mathematics but >> personally, I would tend to assume first (with just about any >> language- unless I had reason to believe otherwise) that - blah is >> equivalent to - (blah). FWIW, - 3 ** 2 === (-3) ** 2 would seem very >> counter intuitive to me and I would probably gripe to myself about an >> odd choice of operation syntax. This particularly makes sense given >> Rasmus's example. The function >> >> function blah($argument){ >> return 3 - $blah ** 2 >> } >> >> Should not by default reverse the sign of $blah as the suggested >> syntax might suggest. Again, just my thought. Yeah, the 0 - 3 vs. - 3 example was actually not very accurate. You are right, the - reverses the sign, so - 3 is more accurately described as (-1) * 3. But that doesn't really change the larger point. -Rasmus