PHP Developers... please join me for a discussion on PHP5.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • StuartD
    Sofa King Band
    • Jul 2002
    • 29903

    #1

    PHP Developers... please join me for a discussion on PHP5.

    We all know that PHP5 is better than PHP4... that's great. But can you give some real world (maybe personal) examples of yours where you've found PHP5 to be preferred over PHP4.

    Don't get me wrong with this thread, I have my own to share but I'd like to have this more as an informative thread for all developers to learn and share.

    It's one thing to read up the new features and new terminology... but I'd love to hear anyone who's been developing for PHP5 to share personal experiences.
    This is me on facebook
    This is me on twitter
  • k0nr4d
    Confirmed User
    • Aug 2006
    • 9231

    #2
    Well, personally the main advantage of 5 over 4 for me is the additional functions. SimpleXML for example, makes parsing xml significantly easier. The addition of file_get_contents/file_put_contents (I forget which was added in php5) has also made it much easier to work with flat files.

    Additionally, php4 has had its end of life announcement, and as of the new year no additional versions of php4 will be released.

    The only incompatibilities between scripts I've seen for php4 not running under php5, is due to register_globals being off by default in php5.
    Mechanical Bunny Media
    Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development

    Comment

    • Arty
      Confirmed User
      • Nov 2002
      • 880

      #3
      Also be careful with the use of array_merge in your code when moving from php4 to 5

      Comment

      • Mutt
        Too lazy to set a custom title
        • Sep 2002
        • 34431

        #4
        Originally posted by k0nr4d
        Well, personally the main advantage of 5 over 4 for me is the additional functions. SimpleXML for example, makes parsing xml significantly easier. The addition of file_get_contents/file_put_contents (I forget which was added in php5) has also made it much easier to work with flat files.

        Additionally, php4 has had its end of life announcement, and as of the new year no additional versions of php4 will be released.

        The only incompatibilities between scripts I've seen for php4 not running under php5, is due to register_globals being off by default in php5.
        goooooooooo k0nr4d !
        I moved my sites to Vacares Hosting. I've saved money, my hair is thicker, lost some weight too! Thanks Sly!

        Comment

        • StuartD
          Sofa King Band
          • Jul 2002
          • 29903

          #5
          Ok, so SimpleXML makes xml easier.

          array_merge() now only takes array types rather than just allowing anything to be merged in.

          Register_globals is now off by default, as it should be.

          Awesome stuff... has anyone been doing some more advanced class/object creation using PHP5 yet?
          This is me on facebook
          This is me on twitter

          Comment

          • Calvinguy
            Confirmed User
            • Oct 2002
            • 1752

            #6
            Originally posted by StuartD
            Ok, so SimpleXML makes xml easier.

            array_merge() now only takes array types rather than just allowing anything to be merged in.

            Register_globals is now off by default, as it should be.

            Awesome stuff... has anyone been doing some more advanced class/object creation using PHP5 yet?
            OOP has changed but it is backwards compatible so you should have no problems, I didn't at least.

            Comment

            • teg0
              Confirmed User
              • Jan 2006
              • 4204

              #7
              SimpleXML hands down. Parsing feeds is effortless.

              Comment

              • AcidMax
                Confirmed User
                • May 2002
                • 1827

                #8
                There were a lot of enhancements to php5, security fixes, speed fixes as well as OOP changes. Things like private, public and static functions etc. PHP5 should be used imho over php4, but hosts have done a poor job of getting php5 in the market place. That being said, php5 has major issues like namespaces. To me PHP5 has pretty much died and most of my stuff has been replaced with other languages that are not only faster but much more structured.

                PHP6 is going to have a lot of these things fixed supposedly , but I will believe it when I see it.
                Latest MMA news. http://www.mmawrapup.com

                Comment

                • StuartD
                  Sofa King Band
                  • Jul 2002
                  • 29903

                  #9
                  Originally posted by Calvinguy
                  OOP has changed but it is backwards compatible so you should have no problems, I didn't at least.
                  Not that I can see, the way it handles child classes and brand new function structures such as __constructor().
                  This is me on facebook
                  This is me on twitter

                  Comment

                  • StuartD
                    Sofa King Band
                    • Jul 2002
                    • 29903

                    #10
                    Originally posted by AcidMax
                    There were a lot of enhancements to php5, security fixes, speed fixes as well as OOP changes. Things like private, public and static functions etc. PHP5 should be used imho over php4, but hosts have done a poor job of getting php5 in the market place. That being said, php5 has major issues like namespaces. To me PHP5 has pretty much died and most of my stuff has been replaced with other languages that are not only faster but much more structured.

                    PHP6 is going to have a lot of these things fixed supposedly , but I will believe it when I see it.
                    What other languages are you using in PHP's place?
                    This is me on facebook
                    This is me on twitter

                    Comment

                    Working...