PHP Namespace Update

Since the writing of my namespace post things have changed. The voting is in (so it’s said) and the new namespace separator is the backslash “\” character. That’s right, the escape sequence character.

This is caused an uproar in the community and I’m personally not a fan of it. At the same time (and after many weeks of debating), I have decided to support this effort. While I’m not a fan of its implementation, I’m still pleased that namespace functionality is being implemented into PHP.

Your thoughts?

Mega World News Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google Yahoo Buzz StumbleUpon Weekend Joy

TAGS:  ,


5 Comments

  1. Totally ILL. This finally is the last thing that kicked our whole work over to python, definitely. We are changing abou 20 old customer sites to python now, because ignorance and narrowmindedness of these php freaks.

    look here:

    Java:
    Attribute/Method access: foo.bar
    Static method access: Foo.bar
    Package access: foo.bar.baz

    C#:
    Attribute/Method access: foo.bar
    Static method access: Foo.bar
    Namespace access: foo.bar.baz

    Python:
    Attribute/Method access: foo.bar
    Static method access: Foo.bar
    Module access: foo.bar.baz

    PHP:
    Attribute/Method access: $foo->bar
    Static method access: Foo::bar
    Namespace access: foo\bar\baz

  2. I feel your pain, my friend. But i’m not ready to give on PHP yet!

  3. You can add ActionScript3

    AS3 :
    Attribute/Method access: foo.bar
    Static method access: Foo.bar
    Package access: foo.bar.baz

    I was writing a MDA PHP framework with the use of namespace, and I thought that the “::” separator sucks but the “\” separator is pointlessness…..

    I will take a look over Python ;D

  4. You can add VB.Net too

    Method access: foo.bar()
    Static method access: Foo.bar()
    Namespace access: Foo.bar.baz()

    LOLX i was writing a custom PHP semi-framework-semi-templating engine and thought about namespaces. searched and found this site… lol i guess i’d forget about using namespaces then.. thanks for the info

  5. And we still need to use the require or include… really?!?!?

    In AS3 youu include the namespace on the class and there is no need to “include” the file… that is so bad in so many ways… after a lot of years working with PHP I really thinking on upgrade my self to sometihng else…

Leave a Reply