Skip navigation.

My experience moving to PHP5

In August of this year, we decided to move from PHP4 to PHP5 for all our future PHP development. The transition was relatively painless, as the core libraries we use (ADOdb, PHPLens, some PEAR modules) are already PHP5 compliant and have been for some time. What's nice about PHP5 is that it caught some errors that have been lingering in our code: PHP5 no longer allows a function to be defined twice, and some basic variable referencing errors that we missed previously.

We have ported our key web applications over to run on PHP5, but for some key customers with extremely large PHP4 code bases, we felt it was safer to keep them running on PHP4 for the time being as the cost of migration would be high; and we weren't sure whether it was worth it as the customers seem to be happy with PHP4's current performance.

Other things that we have changed is that we have transitioned to using XMLHttpRequest for all our Ajax calls. Formerly we were using the excellent JSRS library, but I can already see most programmers we hire in the future will be more familiar with XMLHttpRequest than JSRS. The nice thing about using XMLHttpRequest is that all XMLHttpRequests can be debugged using the excellent Firebug, a Firefox/Mozilla extension that is extremely useful for Javascript debugging.

I admit we are still retrograde when it comes to exploiting PHP5's new functionality. Last month, we had to do a presentation so we moved our PHP5 web application to a notebook. Later I found out that notebook only had PHP4 installed. The web application worked flawlessly.