Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68268 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64707 invoked from network); 20 Jul 2013 10:33:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jul 2013 10:33:08 -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 74.125.82.45 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 74.125.82.45 mail-wg0-f45.google.com Received: from [74.125.82.45] ([74.125.82.45:44274] helo=mail-wg0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B1/F3-13120-2676AE15 for ; Sat, 20 Jul 2013 06:33:08 -0400 Received: by mail-wg0-f45.google.com with SMTP id x12so1239699wgg.24 for ; Sat, 20 Jul 2013 03:33:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding:x-gm-message-state; bh=3CTB+y3OaKn4dNOUBe95vUzhpWheCRxKB8caVn11XaI=; b=IeJk3EEyZl4GShbwTYJcSJPARY+uxFKgp7uTfuJTJgVAOJaZDABC5wjbscx23394Rg GtrTn2hYIQNRWadENG6+j36M0hnjKLkUo+mWXnj/jU61imzxXUnIbvZdB/7ybu2/1Aq6 fxHRgLRjO9M201oKLL5JloAJ+bNjA3KR2c6tRuKhS9zLvFoGc72kXRTy3XyuwOdcLbwS sxmZN7lkhUUPB61uCdv160uFmEFB+wnTXNewr7IJoRUSX0E/I7k56SUWDy2JuYDxu8d4 GFJ4xJzniAR4CC4Bj7bPbi4+JeWm3CpvajOIIbMUX6y/ejcYZNSVyQsOuxsyDdIQAgAg QuxA== X-Received: by 10.194.78.110 with SMTP id a14mr14543626wjx.84.1374316384288; Sat, 20 Jul 2013 03:33:04 -0700 (PDT) Received: from [192.168.1.81] (196.159.118.80.rev.sfr.net. [80.118.159.196]) by mx.google.com with ESMTPSA id u7sm47774708wiw.9.2013.07.20.03.33.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 20 Jul 2013 03:33:03 -0700 (PDT) Message-ID: <51EA675D.7040505@lerdorf.com> Date: Sat, 20 Jul 2013 12:33:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 MIME-Version: 1.0 To: Sherif Ramadan CC: Sara Golemon , Yasuo Ohgaki , PHP internals References: In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQkQGmLwlk1I4sCqXIwtFaHniNWZI5CNnpYoWT2trxobzl7+4VShEjXdmgUSbJoOf8KEkgwh Subject: Re: [PHP-DEV] Operator precedence is undefined? From: rasmus@lerdorf.com (Rasmus Lerdorf) On 07/20/2013 08:00 AM, Sherif Ramadan wrote: > While this is very true it's also a matter of discretion, because the > language doesn't clearly define a lot of things. In fact, one can argue > that there is no language definition at all since PHP doesn't even have a > spec. Though I'm trying to take common sense into consideration and make an > exception that in this case I don't see where removing the comment of > undefined behavior is going to necessarily cause more harm than good. Since > in the case of undefined behavior people will be left to wonder (why > doesn't ever seem to print 5?) We should either elaborate on why it *might* > print 5 in a full note on that page or we should remove the comment > completely. I oppose a documentation that leaves much room for clarity. > > But perhaps for me it was easier to suggest removing the comment than > trying to clarify on why the behavior is undefined. The language spec is a combination of the grammar and the documentation. The documentation has stated this is undefined for a long time now. The reasoning behind it was that since C and C++ both quite explicitly state this is undefined and since implementations of PHP are likely to be in C and C++ chances were pretty good that this undefined behaviour would end up being inherited. Now, as it turns out, we haven't had that many implementations of the language. But, there have been some. Also, optimizers could potentially do something intelligent here that could potentially change the outcome. -Rasmus