You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't know if this should be a separate project or not, but a real benefit it will be to use the parser to transcode newer code to older code that could run on older versions of PHP. This should be one of the logical next steps with this parser.
So the parser can run on older versions of PHP, read newer code then transcode and maybe run the adapted code on the old version of PHP. Basically you could run PHP 5.5 code on PHP 5.2 for example via the Parser and an Adaptor or Transcoder or whatever you want to call it. The reverse process should be possible also, backporting code or forwardporting code auto-magically would be awesome.
But I know such a thing is hugely complex and probably it will never become a reality.
I'd imagine the performance of PHPPHP would be unsuitable for a production environment.
This is something I've considered doing myself, but I concluded that for the effort involved, people might as well just upgrade PHP. The challenge ranges from easy to unrealistically difficult, for reasons that would differ from feature to feature. Try to pick a feature at random and think about how you'd do it yourself. The 5.4 array syntax is easy, but what about generators or $this within closures with the proper protected/private scope? You'll quickly find that as you try to cover all bases, bearing in mind that you're also restricted to static analysis (or would have to program dynamic analysis into the output), it becomes very complex.
Nothing stopping you giving it a try, though - just for the experience.
Backporting PHP code to older version was the original motivation behind this project. I started working on this with https://github.com/nikic/PHP-Backporter, but abandoned it pretty quickly (for no particular technical reason). There is another, newer project with the same goal (https://github.com/igorw/galapagos), but that doesn't look actively developed either.
PHPPHP could theoretically be used for this but a) it is really, really slow and b) it is rather incomplete and there currently is no intention to make it complete.
Don't know if this should be a separate project or not, but a real benefit it will be to use the parser to transcode newer code to older code that could run on older versions of PHP. This should be one of the logical next steps with this parser.
So the parser can run on older versions of PHP, read newer code then transcode and maybe run the adapted code on the old version of PHP. Basically you could run PHP 5.5 code on PHP 5.2 for example via the Parser and an Adaptor or Transcoder or whatever you want to call it. The reverse process should be possible also, backporting code or forwardporting code auto-magically would be awesome.
But I know such a thing is hugely complex and probably it will never become a reality.
LATER EDIT:
Discovered https://github.com/ircmaxell/PHPPHP (PHPPHP VM) maybe this project is more appropriate for this idea :)
The text was updated successfully, but these errors were encountered: