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

From: Date: Sat, 26 Nov 2005 05:10:04 +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 11 12 13  Groups: php.internals 
Request: Send a blank email to internals+get-20490@lists.php.net to get a copy of this message
Hi Oliver, Oliver Grätz wrote:
So if one only allows simple namespaces (no nesting), then one can see that this need to be two namespace constants BUT one has to read the whole line: - one colon means simple constants - three colons: two namespaces constants - two colons: ERROR, undefined
If there were no nesting, then yes, this could be a solution, but I do allow "nested" namespaces, such as this example: namespace php:xml{ class SimpleXMLElement{} } $e = new php:xml:SimpleXMLElement();
My opinion: Throw a parser error for missing third argument and enforce using parentheses. Not allowing constants in namespaces would mean that the current PHP core could not be put inside a "PHP" namespace because (guess what) it contains global constants.
A parse error is already thrown. I wouldn't force using parentheses, as a simple space can be used in this case, as such (notice the space after "bar" is all I added): $x = $y ? foo:bar :baz:stupid;
OLLi PS: How about a unicode symbol (egypt god Ra) as namespace operator. PHP6 will be all about unicode => Yeah, gazillions of new operator symbols. Or register a "PHP namespace separator symbol" that looks like the PHP logo. Just kidding...
LOL! If I could only find it on my keyboard... Regards, Jessie

« previous php.internals (#20490) next »