Re: Question about Namespace patch

From: Date: Mon, 23 Jul 2007 18:08:58 +0000
Subject: Re: Question about Namespace patch
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.internals 
Request: Send a blank email to internals+get-31220@lists.php.net to get a copy of this message
it is up to the _application_ to solve conflicts (i.e., not import everything from both namespaces). Currently, an application can't do
Exactly - not import everything from namespaces. That's what we are doing :)
anything about name conflicts in libraries short of editing the source; namespaces (assuming the libraries adopt them) give the
Actually, they can and they do - they use long names which have high chance to be unique. This works, but this is extremely ugly and inconvenient to work with.
If there are technical reasons (i.e., compile-time name resolution, as you mentioned in passing), I think it'd be beneficial to see a discussion of those.
Compile-time resolution means you don't get performance penalty for namespaces when you are not using it, and have very low costs when you do use it. Allowing blanket imports means we don't know what "new Foo()" means until it is executed - meaning we need to make extra lookups on each class fetch, even if the code doesn't use namespaces at all. That's only one problem with blanket imports. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#31220) next »