Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20665 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16881 invoked by uid 1010); 27 Nov 2005 19:12:24 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 16866 invoked from network); 27 Nov 2005 19:12:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Nov 2005 19:12:24 -0000 X-Host-Fingerprint: 84.60.35.122 dslb-084-060-035-122.pools.arcor-ip.net Received: from ([84.60.35.122:14260] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 3D/3E-56276-8150A834 for ; Sun, 27 Nov 2005 14:12:24 -0500 Message-ID: <3D.3E.56276.8150A834@pb1.pair.com> To: internals@lists.php.net Date: Sun, 27 Nov 2005 20:12:18 +0100 User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: de-DE, de, en-us, en MIME-Version: 1.0 References: <43899587.5050209@fischer.name> In-Reply-To: <43899587.5050209@fischer.name> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Posted-By: 84.60.35.122 Subject: Re: [PHP-DEV] Re: PHP 5.1 (Or How to break tousands of apps out there) From: oliver.graetz@arcor.de (=?ISO-8859-1?Q?Oliver_Gr=E4tz?=) Markus Fischer schrieb: > Kevin Brown wrote: > >>The only scripts that would break (far from "trillions") here would be >>those where you had a space-less ternary statement comparing two >>constants (NOT namespace constants -- they don't even exist yet), as >>in the following case: >> >>define('foo','odd'); >>define('bar','even'); >>$var = rand() % 2 == 1 ? foo:bar; > > Do we have a way getting numbers on how high the probability is that > someone is using two constants in the ternary operator without spaces? How exactly is this a big problem? Is the parser always working from left to right and assigning a token on current context or is it looking at the whole line? Is it impossible to give the ternary operator a higher priority than the namespace operator? Then the implementation could always treat foo:bar as being two constants in the ternary. This way only new code not using whitespace would throw parsing errors which actually means that NO existing code breaks. OLLi