Although PHP5 is out there for a while migration projects from PHP4 is still a present and challenging task for many web developers. Facing such a migration project I found it not very amazing to rewrite all class method definitions by hand – especially, cause I didn’t know every usage of the methods in the tons of PHP files making use of the classes.
Driven by the fear of becoming a code rewriting monkey I wrote a litte helper script. This script looks for the static usage of class methods and rewrites all method definition in the class files if their usage was found. The next step would be to search for explicit non-static, public and private use to adress all kind of usages. The rewritten class is stored in a
Feel free to extend the script – I would be happy if you’d share your enhancements 😉