Hello Bob,
Bob Silva wrote:
For what its worth (not much), I'd rather give up namespace constants and
use : rather than enforce whitespace which is just BAD from a language
perspective. Makes it feel like programming in bash. The concept behind
namespaces (in PHP at least) is rooted in OOP, so requiring a class just to
have constants in your namespace isn't too much to ask for. The parser
should always be able to handle <namespace>:<class>::<whatever> and not
conflict with other syntax.
If we are truly stuck with \ so be it, but I think alternatives with some
level of compromise should be considered before \ is settled upon. It's just
plain awkward IMO.
Bob Silva
Well said :-)! In fact, some months ago, I posted initial support for
functions in namespaces, asking if I should go ahead with this, saying
that I think classes were enough. Several agreed that just allowing
classes in namespaces was enough, including Andi himself. The fact that
I now have complete function support in my patch is just a bonus.
I really don't care for constants in namespaces. If I need them, I can
simply have a "Config" class inside my namespace that contains all the
constants I need (I already use this approach at work, anyways).
Regards,
Jessie Hernandez
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php