PHP Namespace Update

Posted on 09. Nov, 2008 by Will Fitch in News

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?

Tags: ,

Related Articles

4 Responses to “PHP Namespace Update”

  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. Will Fitch

    05. Dec, 2008

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

  3. Sebboon

    24. Jan, 2009

    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. Tire

    28. Nov, 2009

    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

Leave a Reply