I have wrote tool for automatic convert PHP5 scripts to PHP4. It converts new PHP 5 object model features and language constructions into PHP 4 equivalents. This tool may be useful, if you need transfer PHP5 scripts to run under previous version. It is not designated to provides missing functionality (try PHP_Compat), just missing syntax.
Supported are these constructions:
- abstract classes and methods (demo)
- interface, implements (demo)
- new constructor syntax __construct (demo)
- final classes and method
- visibility modifiers public, protected, private (demo)
- static attributes and methods (demo)
- class constants (demo)
- object clonning (demo)
- operator instanceof
- self::
- automatic passing objects as references (see How to emulate PHP5's object model in PHP4)
- type hinting
- support for Doc Comments
- and for exceptions try, throw, catch (it is not full-value replacement, only partial emulation)
Try it here