On 7/24/07, Stanislav Malyshev <[EMAIL PROTECTED]> wrote:
> Because I just want those names directly available in one part of my
> application - the one which uses a lot of SQL. As far as I see this is not
If you want names to be part of global space - don't use namespaces.
Namespaces are meant to take names OUT of global space.
> All other languages I know that have namespaces (Java, python, C++) allow
> programmers to import other namespaces locally - usually for a single
file.
Both Java and Python have much more rigid relations to files than PHP
does - in Java, class is file, more or less, and package is directory,
Is this something that you would consider for PHP ?
As far as I can tell from the list the two main considerations are not
pushing the decision to the executor and it being simple.
Would this not satisfy all of the above. At compile time you could
import everything and still know where it came from because ultimately
you have the namespace from the location of the file.
Its pretty easy to explain, you did it in one line, and it would solve
other peoples issues with namespaces without polluting the global
namespace.
The only downside is that this now requires a 1 class / file. This
IMHO isn't a massive problem as long as it can be explained, and those
who have the task of splitting this up now can do an import Foo::*; ?
thoughts?
Andrew
while in Python module is file and package is directory. Also, Java is a
compiled language - meaning you have much more information in compile
time than with PHP - all classes you use are to be known compile-time.
--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED] http://www.zend.com/
(408)253-8829 MSN: [EMAIL PROTECTED]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php