Re: Re: PHP 5.1 (Or How to break tousands of apps out there)

From: Date: Fri, 25 Nov 2005 22:12:17 +0000
Subject: Re: Re: PHP 5.1 (Or How to break tousands of apps out there)
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.internals php.internals 
Request: Send a blank email to internals+get-20456@lists.php.net to get a copy of this message
Hi Marcus, Marcus Boerger wrote:
Hello Jessie, that's only one case,go with consts. now try $x = $y ? foo:bar:baz:stupid; now what? best regards marcus
Here it'll fail. My patch is basically allowing colons inside the class/function/constant name, so whitespace here is _crucial_, i.e., the following example WOULD work: $x = $y ? foo:bar : baz:stupid; Notice the space between the middle colon. Here it correctly identifies the constants "foo:bar" and "baz:stupid". In the former case, it interpreted "foo:bar:baz:stupid" and got the semicolon before getting the ternary's colon, so it would produce a syntax error. This doesn't seem like an actual problem to me though. Even though I somehow managed to your example work, would you really want to accept spaghetti code like this to work? Having proper spacing here is important for clarity, and as a side effect of my patch, I am enforcing this code-cleanness (never thought of this effect before). Regards, Jessie

« previous php.internals (#20456) next »