We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26435
    • 1,193 Posts
    PHP developers cannot leverage PHP 5’s full potential without dropping support for PHP 4, but PHP 4 is still installed on a majority of shared web hosts and users would then be forced to switch to a different application. Web hosts cannot upgrade their servers to PHP 5 without making it impossible for their users to run PHP 4-targeted web apps, and have no incentive to go to the effort of testing and deploying PHP 5 while most web apps are still compatible with PHP 4 and the PHP development team still provides maintenance support for PHP 4. The PHP development team, of course, can’t drop maintenance support for PHP 4 while most web hosts still run PHP 4.
    Although it now appears that the PHP development team will drop support for PHP 4.x at the end of 2007!!! grin grin grin

    My last two projects have been written to take advantage of PHP 5 (primarily for member/data encapsulation) but that has made them wholly incompatible with PHP 4.x as a result.

    What are your thoughts?

    -sD-
    Dr. Scotty Delicious, Scientist.
      Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
      All of the above... in no specific order.


      I send pointless little messages
      • 22303 MODX Staff
      • 10,725 Posts
      Scotty:

      These were exactly some of the challenges I was faced with when I set out to redesign MODx in an object-oriented fashion, and after experimenting with the various PHP 5 only features and weighing the open-source audience, I came to the conclusion that whatever the official PHP developer’s support of PHP 4 may be, the reality is we still have a few years left with a substantial number of PHP 4 environments that I didn’t want to ignore. Thus, I made it PHP-4 compatible, yet aimed to allow those using it on PHP 5 to be able to take advantage of what improvements they could (e.g. PDO emulation allowing PHP 4 users to write PDO code that would also work with native PDO). There are some rules (and thus a little added complexity) for how to do things to maintain PHP 4 compatibility with the new MODx, but overall, the only thing I felt I was really sacrificing in the implementation was being able to take advantage of exception handling.

      However, I also feel that PHP 4 has reached end-of-life and is hampering more progress than I would like, so I have already started working on a PHP 5.2+ version of xPDO that will take full advantage of exception handling, variable access modifiers (private, public), and other PHP 5.2+ only features, aiming for E_STRICT compliance. And MODx classes (or any "models" built on previous versions of xPDO) will be easy to refactor for the change. But anyway, I can definitely say it is liberating (and a whole lot less frustrating) to develop for PHP 5 directly, without worrying about compatibility, and the resulting code is a little more elegant and compact, if nothing else.

      < End of pointless rambling >
      wink
        • 22098
        • 218 Posts
        most companies and servers we work for/on don’t even support PHP5 yet.... so it’s PHP4 for us..

        Olaf
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          I just got a notice from my hosting company that they have been testing 5 for over a year now, and will be upgrading all their servers to 5 in a few weeks, and will no longer support 4, although it will be available as a secondary option for a while:

          We have no set time line but it will be at least until the end of 2007 which is when official support for it ends. Beyond this, anyone using PHP4 does so at their own risk knowing that it may need to be removed at any time if for example a security issue comes up with no update released by the makers.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 7231
            • 4,205 Posts
            I dabble in php. Although I am fluent in php4 I have yet to learn the differences with php5. I haven’t learned this yet mainly because I have been focusing on other stuff and until now php4 was still the mainstream. I guess that the time has come that I will finally need to refresh my php skills to upgrade to 5. Anyone know of a quick stop reference for learning about the differences?

            My server offers both, but 4 is the default. Not sure if cPanel is 5 compatible yet.
              [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

              Something is happening here, but you don&#39;t know what it is.
              Do you, Mr. Jones? - [bob dylan]
              • 21257 MODX Staff
              • 730 Posts
              I have php code across about a dozen web hosts. I am never involved in the selection of web host, so I basically have to work with what I am given. I was excited about php 5 when it first happened, but my hands were tied, not being able to use it in real-world projects. I figure that in 6 months, I will be writing in php 5 and reviewing/updating a ton of php 4 code when certain hosters make a "hard switch" from 4 to 5. I prefer hosters who allow you to select which version of php is running on a site, or even select it at the directory or file level, but again, I don’t get to make that choice.
                Mike Schell
                Lead Developer, MODX Cloud
                Email: [email protected]
                GitHub: https://github.com/netProphET/
                Twitter: @mkschell
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org