Actually, I think it’s possible, but I don’t think it is worth it. The idea would be to create a default stream wrapper that will parse the PHP files according to the new grammar and make the appropriate syntax changes so that it will be valid PHP <5.3.
The shell will have to replace class names such as Foo\Bar\Baz with Foo_Bar_Baz . Currently, I'm not sure if there is anything that would make this impossible.
In any case, I do not think this is worth the effort. Update PHP 5.3.
Oh, that means the shell code must be compatible with PHP <5.3.
source share