> Von: Jessie Hernandez > So, the question is, can we scrap both namespace constants > and namespace functions and just stay with classes (as was > agreed on several months ago, Andi himself agreeing to it)? ... > I think this is the best solution thus far. If any one of you > still feels a need for constants/functions, PLEASE show me a > _valid_ example that cannot be accomplished by just simply > putting the constant/function inside a class in the namespace.
Bart de Boer came up with a good reason for them so I'd like to re-post his statement. <quote> Namespace constants can be handy if you'd want to include some library that uses predefined constants and classes that might conflict with other classes and constants in the script. namespace someLib { include('huge_conflicting_library_that_I_dont_want_to_reverse_engineer') ; } </quote> Of course, that would not only require to put defines [=constants?] and functions in namespaces, but variables as well. namespace X { var $foo = 1; function bar($p) {} } X::bar(X::$foo); which can, of course, not easily be distinguished from static class members. So is the whole "include-legacy-stuff-into-namespace"-approach beyond the scope of what you're trying to do? -mp. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php