Re: my last attempt at sanity with namespaces

From: Date: Fri, 17 Oct 2008 00:17:18 +0000
Subject: Re: my last attempt at sanity with namespaces
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-41180@lists.php.net to get a copy of this message
Hi!
Yes, but most times when there is conflict it will be between two sets of code. So importing someone else's namespace explicitly and giving it a new name is a good call IMHO.
If you have two distinct sets of code, why you use same namespace for both of them? Namespaces are specifically designed so you could have different sets of code in different places.
nb Stas - I asked the same question about warnings, Greg updated his proposal since then to answer it.
As it is now, every call to class::method() not accompanied with use should produce E_WARNING. I do not think it is an acceptable situation - this would make code migration a nightmare, since even if you never use functions and never even have any chance for a conflict, you still have to insert hundreds of imports into your code, just to shut up the warnings. I don't think it is a good idea. Feature that you do not need, can not disable and have to work around is called "bug". -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#41180) next »