Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70356 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49250 invoked from network); 24 Nov 2013 17:21:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Nov 2013 17:21:26 -0000 Authentication-Results: pb1.pair.com header.from=sean@seancoates.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=sean@seancoates.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain seancoates.com from 64.15.79.181 cause and error) X-PHP-List-Original-Sender: sean@seancoates.com X-Host-Fingerprint: 64.15.79.181 iconoclast.caedmon.net Received: from [64.15.79.181] ([64.15.79.181:47150] helo=iconoclast.caedmon.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 51/76-10115-49532925 for ; Sun, 24 Nov 2013 12:21:25 -0500 Received: from localhost (localhost [127.0.0.1]) by iconoclast.caedmon.net (Postfix) with ESMTP id 38FCB784064; Sun, 24 Nov 2013 12:21:20 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at iconoclast.caedmon.net Received: from iconoclast.caedmon.net ([127.0.0.1]) by localhost (iconoclast.caedmon.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1aTLBxS94Vtr; Sun, 24 Nov 2013 12:21:18 -0500 (EST) Received: from [10.8.0.2] (sarcasm.vpn [10.8.0.2]) by iconoclast.caedmon.net (Postfix) with ESMTPS id 3116C784063; Sun, 24 Nov 2013 12:21:15 -0500 (EST) Content-Type: multipart/alternative; boundary="Apple-Mail=_E356F669-818F-4798-A70D-A0D4FC8513C3" Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) In-Reply-To: Date: Sun, 24 Nov 2013 12:21:26 -0500 Cc: Tjerk Meesters , PHP Internals Message-ID: References: To: Pierre Joye X-Mailer: Apple Mail (2.1503) Subject: Re: [PHP-DEV] Re: rfc: pow-operator From: sean@seancoates.com (Sean Coates) --Apple-Mail=_E356F669-818F-4798-A70D-A0D4FC8513C3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 > 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. This approach also makes the syntax much less ambiguous: pow(-3, 2) // we know what this does, already=85 Perhaps the only drawback to this is in the strict comparison operator = (if it returns a GMP object instead of strictly a number)=85? As a further aside: in 15 years of PHP dev, I've rarely used pow() and = I've never ever seen it show up as a bottleneck of any sort in = profiling. Searching GitHub correlates that I'm not alone here: for PHP, = a search for "pow(" yields 280,769 code results vs. 4,886,604 for = "trim(". At a glance, many of these are inefficient bitwise operations. S= --Apple-Mail=_E356F669-818F-4798-A70D-A0D4FC8513C3--