SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 31 of 31
  1. #26
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Basically namespace is a container.
    http://en.wikipedia.org/wiki/Namespa...ter_science%29
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  2. #27
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Divisive Cotton View Post
    I was reading in articles that the main feature of PHP 5.3 are namespaces - can anybody take the time to explain exactly what namespaces are and how they will be useful?
    In pre 5.3, class names are global. If I create a class Foo and you create a class Foo, they would conflict. This can be remedied by prefixing the names with something unuiqe. Eg. I would name my class kyberfabrikken_Foo and you would name yours divisivecotton_Foo. However, this leads to rather clumsy looking code. (Just take a look at Zend Framework to see what I mean). With namespaces, you declare a prefix (namespace) for the entire file you're in. So within that file, you can use the short name. Other files can import the namespace and likewise use the short name. Only when there is an actual conflict, do you have to use the explicit name. So namespaces doesn't add something entirely new, but it makes it a heck more elegant to do.

  3. #28
    SitePoint Wizard bronze trophy devbanana's Avatar
    Join Date
    Apr 2006
    Location
    Pennsylvania
    Posts
    1,736
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My question is, if 5.3 has so many changes, why didn't they release it as 6.0?

    Unfortunately, yum's version is stuck back in 5.1.6. I wish they'd upgrade.

  4. #29
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Well the reason why it is 5.3 is because it will feel less of a major upgrade and more of a minor upgrade to server admins. And PHP 6 is currently being mostly rewritten to incorporate Unicode right in the core.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  5. #30
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I suspect hosts/distros will be slower to upgrade to 5.3 than another 5.2 releases.
    CentOS still uses a pre-5.2 release which is a pain.

  6. #31
    SitePoint Wizard
    Join Date
    Mar 2008
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Plus, we can start using the features earlier (though not right away), so when PHP 6 comes rolling around, we can already have some things ready.

    For example, the binary data type in PHP was backported from 6.0 to 5.2.? so that less things would break when PHP 6 rolls around.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •