Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68258 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42036 invoked from network); 20 Jul 2013 06:25:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jul 2013 06:25:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.178 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.217.178 mail-lb0-f178.google.com Received: from [209.85.217.178] ([209.85.217.178:59367] helo=mail-lb0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 14/EF-13120-B5D2AE15 for ; Sat, 20 Jul 2013 02:25:32 -0400 Received: by mail-lb0-f178.google.com with SMTP id y6so3910493lbh.23 for ; Fri, 19 Jul 2013 23:25:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=sZ7xD/0yXJh1/zSc4L6/l16piIRvKsFjVmm8oVSpTIA=; b=zNbbILN9Y44yKlrJfYvC8QposeRxW/giXemhTpoKl+XS4ixrmZ7l9nzV17YobP9nrX 4rGhN/poWmDnmIe/1Y5+L0gqWPR4k61gldJqgZ1VUggEugeueZeCuktexx4Y7mW40hdQ 0L1Xe5+dZnEvQLxH+YyFWNDOKuNJgeQqhgtv21NFU0Cjqvh8mmQOmzywPILfHxYbtsDd mTqePMgLiAFfrndkX87DseRUE4JKQ0VIW4kaP/4KCBhhe7sLWM9SCO9afo82dsQ0uYP6 s7/SsbVmuqhWDlORWw4aEKJdTY6PsuXAZMICs+qKXHGCl/LuALjTcIX7W1iG1tCd10DG 8nBg== MIME-Version: 1.0 X-Received: by 10.112.140.231 with SMTP id rj7mr8936499lbb.16.1374301528705; Fri, 19 Jul 2013 23:25:28 -0700 (PDT) Sender: yohgaki@gmail.com Received: by 10.112.4.233 with HTTP; Fri, 19 Jul 2013 23:25:28 -0700 (PDT) Received: by 10.112.4.233 with HTTP; Fri, 19 Jul 2013 23:25:28 -0700 (PDT) In-Reply-To: References: Date: Sat, 20 Jul 2013 15:25:28 +0900 X-Google-Sender-Auth: JPLQ6K7V3MJg4qs6JqpF6ZuQIw8 Message-ID: To: Sara Golemon Cc: Sherif Ramadan , PHP internals Content-Type: multipart/alternative; boundary=001a11c26a306ed0e104e1eb8274 Subject: Re: [PHP-DEV] Operator precedence is undefined? From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c26a306ed0e104e1eb8274 Content-Type: text/plain; charset=UTF-8 Hi Sara, 2013/7/20 Sara Golemon > > What's undefined isn't the relationship between preinc/postinc and add. What's undefined is the use of multiple preinc/postinc operators within a single expression (preincrements in particular). Our parser grammer, as it currently stands, does have a predictable order, but that is a side-effect of implementation. The language's definition of order of resolution of multiple preinc/postinc elements within a single ticked statement is that they are undefined. And *that* is what made your *particular* change to the documentation incorrect. > > If you'd like to define behavior for: echo ++$a + 1; then that's a different matter. Defining the behavior of ++$a + $a++, however is inviting misunderstanding*. > > What was inappropriate, was asking for comment, receiving comment which cited an issue, then committing without discussing that issue first. > > -Sara > > * Even if, technically, either order of evaluation will result in the same answer for this contrived expression. ++$a * $a++ is a more obviously ambiguous answer for a language which explicitly does not define an order of resolution. ++/-- can be problematic for compilers when it is applied to in the same arithmetic operator. I can agree with this. It depends on compiler implementation. I understand you suggesting users are suggested not to use -- ++ for the same vars on the same arithmetic operations. Is this correct? Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c26a306ed0e104e1eb8274--