PHP5 --> PHP4 Conversion
Posted: Thu May 25, 2006 9:08 am
Just curious whether anyone has ever discovered a need to backtrack a PHP5 application/class down to PHP4 compliance and found a decent method to automate the process given the PHP5 code is not so dependent on PHP5 features as to make this impossible.
Maybe I'm insane, but I've tired of sticking with PHP4, and am moving to PHP5 for several projects. The uncertain goal is to enable a largely autmated process to convert the PHP5 code into PHP4 friendly forms. I'm thinking it would involve file rewriting (replacing PHP5 syntax with PHP4), extracting PHP5 dependent code into independent classes or simply keeping PHP4/5 variants of the class on hold, and having a possible separate tree of file writing rules (maybe a bit like phpBB module system for changing core files).
Am I completely off my rocker?
The motivation for retaining PHP4 as an option is that the majority of users on shared hosting are likely to require the fallback. In the meantime I prefer coding in PHP5 and enjoying type casting and private/public declarations that make debugging and interface enforcement a much more pleasant experience. As well as avoiding some fuzzy logic since PHP4's class properties might as well be globals...
Maybe I'm insane, but I've tired of sticking with PHP4, and am moving to PHP5 for several projects. The uncertain goal is to enable a largely autmated process to convert the PHP5 code into PHP4 friendly forms. I'm thinking it would involve file rewriting (replacing PHP5 syntax with PHP4), extracting PHP5 dependent code into independent classes or simply keeping PHP4/5 variants of the class on hold, and having a possible separate tree of file writing rules (maybe a bit like phpBB module system for changing core files).
Am I completely off my rocker?
The motivation for retaining PHP4 as an option is that the majority of users on shared hosting are likely to require the fallback. In the meantime I prefer coding in PHP5 and enjoying type casting and private/public declarations that make debugging and interface enforcement a much more pleasant experience. As well as avoiding some fuzzy logic since PHP4's class properties might as well be globals...