Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70369 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3220 invoked from network); 25 Nov 2013 07:01:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Nov 2013 07:01:15 -0000 Authentication-Results: pb1.pair.com smtp.mail=tjerk.meesters@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tjerk.meesters@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.50 as permitted sender) X-PHP-List-Original-Sender: tjerk.meesters@gmail.com X-Host-Fingerprint: 209.85.212.50 mail-vb0-f50.google.com Received: from [209.85.212.50] ([209.85.212.50:54687] helo=mail-vb0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5A/50-34377-AB5F2925 for ; Mon, 25 Nov 2013 02:01:15 -0500 Received: by mail-vb0-f50.google.com with SMTP id 10so2462380vbe.37 for ; Sun, 24 Nov 2013 23:01:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=NQVNun0M8CkjTne0UhU7jgjt/ItXw4FBUUcm7eTy/RA=; b=JjsyimuKEr/fx/txJDCGp/LtQq8Ap81Fxd4pDhyxXYZJEJ7tbPPsZSpGL1FE2N8e7Y 4/RZox8fWUlQKhhVt3vAnjwKwV8RvbE2LX85AFI4ZjtzQSiB6tfYg1GwbspzxgPL7RZ8 the6yyH8R8MX4as9yoU8oCMJsP4rkkbbWdjNVXWE1Y8LFnxNikBTRKMceXIRiWQ369tP gA29KJ/MiU/DtfLjSxDDyCPhDChWJXXYnmq9h0PSM0Ou5Fz8Z3rmKkg+3c4I0S9NQGSf 8EmBp6CmfyD5mu5nhr92E2D3KcWf1xZYrFUJ2bR0xsRQxnZghWZgkLfcLv4dbHwIblsX X0yA== MIME-Version: 1.0 X-Received: by 10.58.11.73 with SMTP id o9mr24842436veb.8.1385362871706; Sun, 24 Nov 2013 23:01:11 -0800 (PST) Received: by 10.58.128.33 with HTTP; Sun, 24 Nov 2013 23:01:11 -0800 (PST) In-Reply-To: References: Date: Mon, 25 Nov 2013 15:01:11 +0800 Message-ID: To: Pierre Joye Cc: Chris London , PHP Internals Content-Type: multipart/alternative; boundary=047d7b2ed341da6b7604ebfaedd9 Subject: Re: [PHP-DEV] Re: rfc: pow-operator From: tjerk.meesters@gmail.com (Tjerk Meesters) --047d7b2ed341da6b7604ebfaedd9 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Nov 25, 2013 at 8:38 AM, Tjerk Meesters wrote: > Hi Pierre, > > > On Sun, Nov 24, 2013 at 11:56 PM, Pierre Joye wrote: > >> On Sun, Nov 24, 2013 at 4:26 PM, Chris London wrote: >> > On Sun, Nov 24, 2013 at 7:15 AM, Tjerk Meesters < >> tjerk.meesters@gmail.com>wrote: >> >> >> >> 2. The available votes for the associativity is reduced to either >> right or >> >> non associative; I'd rather see it done right (pun intended) or done >> in a >> >> way whereby the developer must put parentheses to disambiguate. >> >> >> > >> > I completely agree. Here's another resource that explains a little more >> why >> > the exponent comes before the negation: >> > http://mathforum.org/library/drmath/view/55709.html >> >> Replying here about the general idea of having power as an operator, I >> really like the optimization brought by this change. >> >> However I don't really like ** and all the confusions it brings >> (whether other languages support it or not, from a precedence point of >> view). >> >> Should it not be possible to do something similar than isset? Changing >> pow from a function to operator? The big advantage is that any >> existing code will benefit from it without code changes. >> > > Speeding up existing code sounds like a very good idea actually :) I'll > look into this. > Following up on this; I've turned pow() into a language construct now. The only caveat I could see is: pow(array(), 2) === int(0) // used to be float(0) Otherwise this gives all the advantages of the operator without developers having to change anything, which is great! This will get added to the RFC soon. And thanks for the idea :) > >> >> Cheers, >> -- >> Pierre >> >> @pierrejoye | http://www.libgd.org >> > > > > -- > -- > Tjerk > -- -- Tjerk --047d7b2ed341da6b7604ebfaedd9--