SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 60

Hybrid View

  1. #1
    PHP/Rails Developer Czaries's Avatar
    Join Date
    May 2004
    Location
    Central USA
    Posts
    806
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation How will PHP 5.3 affect your application?

    I just got through reading SitePoint's new article on PHP 5.3. It seems very interesting that the PHP group decided to release all those new features in a PHP5 release instead of waiting for PHP6. How will these new changes affect your PHP application development?

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,603
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Not at all for quite a while. Too many of my customers are still using older versions.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    At first i would alter all __autoload hooks to handle namespaces.

  4. #4
    SitePoint Addict Jasper Bekkers's Avatar
    Join Date
    May 2007
    Location
    The Netherlands
    Posts
    282
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Looking at the feature set, I'd say that this is PHP5 the way PHP5 should have been done years ago. It's nice that they back-ported the nonbreaking changes made to PHP6, of which namespaces are probably the most useful addition.
    Design patterns: trying to do Smalltalk in Java.
    I blog too, you know.

  5. #5
    PHP/Rails Developer Czaries's Avatar
    Join Date
    May 2004
    Location
    Central USA
    Posts
    806
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Jasper Bekkers View Post
    Looking at the feature set, I'd say that this is PHP5 the way PHP5 should have been done years ago. It's nice that they back-ported the nonbreaking changes made to PHP6, of which namespaces are probably the most useful addition.
    I do agree that namespaces are definitely the most useful feature. That is really the first new feature addition that I plan on using myself. But, like felgall, I don't plan on using it for a while (at least a couple versions after 5.3).

  6. #6
    Resident Code Monkey Chris Corbyn's Avatar
    Join Date
    Nov 2005
    Location
    Melbourne, Australia
    Posts
    713
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I hate the syntax for accessing the global namespace.

    ::function()

    I'd probably rather a C++ style approach with 'std' or 'php':

    php::function();

    Meh, or even just 'global::function()'. Just something on the left of that namespace operator.

  7. #7
    SitePoint Addict Jasper Bekkers's Avatar
    Join Date
    May 2007
    Location
    The Netherlands
    Posts
    282
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Chris Corbyn View Post
    I hate the syntax for accessing the global namespace.

    ::function()

    I'd probably rather a C++ style approach with 'std' or 'php':

    php::function();

    Meh, or even just 'global::function()'. Just something on the left of that namespace operator.
    Using ::function actually is the way you access the global namespace in C++.
    Design patterns: trying to do Smalltalk in Java.
    I blog too, you know.

  8. #8
    Resident Code Monkey Chris Corbyn's Avatar
    Join Date
    Nov 2005
    Location
    Melbourne, Australia
    Posts
    713
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Jasper Bekkers View Post
    Using ::function actually is the way you access the global namespace in C++.
    Fail!

  9. #9
    SitePoint Addict pachanga's Avatar
    Join Date
    Mar 2004
    Location
    Russia, Penza
    Posts
    265
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The article doesn't mention possible inclusion of proper Garbage Collection implementation, anonymous functions/closures support, simplified arrays declaration and, who knows, maybe traits(a kind of Ruby alike mixins).

    PHP-5.3 is definitely HOT

  10. #10
    SitePoint Addict
    Join Date
    Feb 2006
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How do these name sapces actually work?

    1. Do you put the namespaces at the top of files?
    2. How to combine it with autoload?

    Is it like:

    Directory::SubDirectory::File.php

    What is it supposed to do?

  11. #11
    PHP/Rails Developer Czaries's Avatar
    Join Date
    May 2004
    Location
    Central USA
    Posts
    806
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by blueyon View Post
    How do these name sapces actually work?

    1. Do you put the namespaces at the top of files?
    2. How to combine it with autoload?

    Is it like:

    Directory::SubDirectory::File.php

    What is it supposed to do?
    Just read the linked article - it has a great explanation of the advantages of using namespaces.

  12. #12
    SitePoint Guru
    Join Date
    May 2005
    Location
    Finland
    Posts
    608
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pachanga View Post
    The article doesn't mention possible inclusion of proper Garbage Collection implementation, anonymous functions/closures support, simplified arrays declaration and, who knows, maybe traits(a kind of Ruby alike mixins).

    PHP-5.3 is definitely HOT
    Could I please have a source for this? Are any of those actually likely to get in?

  13. #13
    SitePoint Member
    Join Date
    Feb 2007
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ezku View Post
    Could I please have a source for this? Are any of those actually likely to get in?
    Traits - http://marc.info/?l=php-internals&m=120336491008719&w=2
    GC - http://marc.info/?l=php-internals&m=119671595717285&w=2
    Anonymous functions/closures - http://marc.info/?l=php-internals&m=119833623532713&w=2
    Array shorcuts - http://marc.info/?l=php-internals&m=119995972028293&w=2

  14. #14
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,011
    Mentioned
    56 Post(s)
    Tagged
    0 Thread(s)
    Namespaces will have the biggest impact for me as well as others. I currently use a static class to serve as a psuedo namespace - this way none of my variables have to occupy the global (and only) namespace of php. So instead of writing PAMWF::$db all the time, I can do just $db. $ctrl instead of PAMWF::$ctrl and so on.

    Constants will be nice to name. WEBROOT instead of PAMWF_WEBROOT. DP instead of PAMWF_DB_PREFIX. DS instead of DIRECTORY_SEPERATOR.

    And classes. PAMWF_Class replaced by Object. DATABASE instead of PAMWF_DATABASE and so on.

    That alone will be dreamy. I went to a lot of effort to make sure my framework will run without distrubing other PHP applications like vbulletin - now with namespacing this isn't an issue anymore.

  15. #15
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Michael Morris View Post
    ....DS instead of DIRECTORY_SEPERATOR....
    You don't really need DIRECTORY_SEPERATOR the only OS I know that doesn't use / is Windows which uses the backslash \ however, Windows does support the use of the forwardslash in paths making the use of DIRECTORY_SEPERATOR superfluous.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  16. #16
    SitePoint Guru
    Join Date
    May 2005
    Location
    Finland
    Posts
    608
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a bunch. It does seem to me, though, that not accounting for the GC patch that does not add any actual features, the chances for any of those getting through to the actual PHP 5.3 release are slim.

    And that's sad; especially Traits would seem thoroughly awesome.

  17. #17
    SitePoint Wizard dreamscape's Avatar
    Join Date
    Aug 2005
    Posts
    1,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ezku View Post
    And that's sad; especially Traits would seem thoroughly awesome.
    Couldn't agree more... anything that puts us a few steps closer to native AOP support gets a big thumbs up from me.
    <.smarter.web.development.>
    PHP Stuff: Plexus | Chocolate (BDD Framework... coming soon)
    Graphite

  18. #18
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    I would be using the dev version of PHP 5.3 right now if xdebug was working with my combination of software.

    Windows Vista + Apache 2.2.8 + PHP 5.3-dev + xdebug 2.0.2 built to PHP 5.3

    Every time I load xdebug then try and run any PHP page the child process (PHP) resets making firefox show a connection reset error page.

    If it wasn't for this little hiccup I would be using it extensively right now -.-
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  19. #19
    SitePoint Guru
    Join Date
    Nov 2003
    Location
    Huntsville AL
    Posts
    664
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Czaries View Post
    How will these new changes affect your PHP application development?
    I hope the changes won't impact my development at least for the near future. Not planning on using any of the new stuff for a bit. Just hope it's a clean upgrade. Seems like the Zend folks are taking a bit of a risk by introducing so much new stuff.

  20. #20
    PHP/Rails Developer Czaries's Avatar
    Join Date
    May 2004
    Location
    Central USA
    Posts
    806
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow, daxterj - thanks for the links! I'll be reading up on those a little more now, although I'm not so sure about that garbage collector patch...

  21. #21
    SitePoint Addict pachanga's Avatar
    Join Date
    Mar 2004
    Location
    Russia, Penza
    Posts
    265
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Czaries View Post
    Wow, daxterj - thanks for the links! I'll be reading up on those a little more now, although I'm not so sure about that garbage collector patch...
    It's already in CVS PHP5_3 branch...

  22. #22
    SitePoint Zealot impunjabians's Avatar
    Join Date
    Dec 2007
    Location
    Bed Room
    Posts
    134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    whenever new version of current technology , people adopt it as soon as possible, but what about old customers and all the servers in this case are using old PHP versions ,

    immediaate shift of , such kind, is some sort of risky step.

  23. #23
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,011
    Mentioned
    56 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by impunjabians View Post
    whenever new version of current technology , people adopt it as soon as possible, but what about old customers and all the servers in this case are using old PHP versions ,

    immediaate shift of , such kind, is some sort of risky step.
    Forget 'em. If people like that are allowed to control the world we'd still be computing on Commodore 64's

  24. #24
    We're from teh basements.
    Join Date
    Apr 2007
    Posts
    1,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Traits would definitely be more useful than namespaces to me at the moment. My applications consist entirely of classes I've written myself, so there aren't any naming conflicts. I do often write classes that have several methods in common and copy-and-paste code from an old class into a newer one.

  25. #25
    SitePoint Wizard Hammer65's Avatar
    Join Date
    Nov 2004
    Location
    Lincoln Nebraska
    Posts
    1,160
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by World Wide Weird View Post
    Traits would definitely be more useful than namespaces to me at the moment. My applications consist entirely of classes I've written myself, so there aren't any naming conflicts. I do often write classes that have several methods in common and copy-and-paste code from an old class into a newer one.
    You can still get naming conflicts with classes, it's just less likely. You could also get naming collisions with namespaces, but even less likely.
    Visit my blog
    PHP && Life
    for technology articles and musings.


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
  •