However, in the global scope (no namespace) it would fail. This is a
bug that is easily fixed. use should allow re-aliasing of global
classes, and I could provide a very easy fix.
This is not a bug - since there you work with test::xmlreader, which of
course you can define. But in global space you'd work with existing name
xmlreader, which would be redefined. And PHP never allowed redefining
classes.
I'm truly glad you said that's not a bug, my world just started to make
sense again. But Stas, consider (old dialect bc I need to update locally
sorry):
import nstest::test as whatever;
This works in the global space, right? Now along comes, say, Pierre or
Derick or Marcus with this class they just have to add to an existing
(non-namespaced) core extension, and the obvious and perfect name for this
class happens to be 'whatever'. I upgrade PHP and suddenly I start seeing
Fatal error: Import name 'whatever' conflicts with defined class in ...
Now sure, I can fix that. I can search and replace all my instances of
'whatever' in my code. How is that different from what we had before?
Greg would say I should've namespaced this file, I know... but it's possible
to use import (OK, 'use' now) in the global space, so how are you going to
prevent people from doing that?
- Steph
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php