Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70350 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31689 invoked from network); 24 Nov 2013 11:05:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Nov 2013 11:05:44 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.180 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.214.180 mail-ob0-f180.google.com Received: from [209.85.214.180] ([209.85.214.180:49432] helo=mail-ob0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0B/93-10115-88DD1925 for ; Sun, 24 Nov 2013 06:05:44 -0500 Received: by mail-ob0-f180.google.com with SMTP id wo20so3061439obc.39 for ; Sun, 24 Nov 2013 03:05:41 -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=zEd+ZV99YUqDXkmIPxznCz8bq5iH9wpCxE0Di93pCc4=; b=B2ggvUYGKqxeCu8h3jSqkerYh1TlDyy74Wpf3+Ak+FY+Pf8NtIDTf+38h9xgXlj897 oYvmElcOpxrzi7tNLqTXEA8OT6OBdbq4E7I76vQ1fJFkx/ydZy1rcqj0JPijNGCRvN8T XODwNmngpqJbyiTm8NZ/Kai8tvVWwwuDdKExIWy3+D4VJv8+D03J6t3dLTXW/zeA91Eu 7Ha3F+4EymqkWaYggAL8lH9uLf9E63DDp4uA3RrYWvQ6/0eUwxGZ2lhsw4s1Su8ROFgP /MlQ7T7LGu3LpU8PkjbVYgF9CMkpIotm6RanEfU/rYYowrnBZRWTveeX/xWieB84Hfvj nX6A== MIME-Version: 1.0 X-Received: by 10.182.230.135 with SMTP id sy7mr19461976obc.24.1385291141014; Sun, 24 Nov 2013 03:05:41 -0800 (PST) Received: by 10.182.54.112 with HTTP; Sun, 24 Nov 2013 03:05:40 -0800 (PST) In-Reply-To: References: Date: Sun, 24 Nov 2013 12:05:40 +0100 Message-ID: To: Tjerk Meesters Cc: Kris Craig , Derick Rethans , PHP Internals Content-Type: multipart/alternative; boundary=001a11c336765eea3304ebea3a31 Subject: Re: [PHP-DEV] rfc: pow-operator From: nikita.ppv@gmail.com (Nikita Popov) --001a11c336765eea3304ebea3a31 Content-Type: text/plain; charset=ISO-8859-1 On Sun, Nov 24, 2013 at 7:58 AM, Tjerk Meesters wrote: > On Sun, Nov 24, 2013 at 8:31 AM, Kris Craig wrote: > > > We should be following standard Order of Operations here. As such, the > > option of no associativity should be included. Furthermore, there needs > to > > be a voting option regarding how to deal with even exponents of negative > > bases; i.e. treat "-3 ^ 2" as "-3 ^ 2 == 9" or as "-(3 ^ 2) == -9". > > > > To support the latter "-3 ** 2 == 9" we would require a unary minus that > has a higher precedence than the exponent operator and as such falls > outside of the scope of this RFC. > > That said, I'm not even sure whether we can support a unary minus with the > current parser. > Huh? We already support a unary minus with the current parser. It has the same precedence and associativity as ++ (%prec). You can adjust the relative precedence of ** and - by adjusting the relative precedence of ** and T_INC (or making it completely independent if you like.) Nikita --001a11c336765eea3304ebea3a31--