Hacker News new | ask | show | jobs
by mjburgess 3270 days ago
This isnt running PHP in the browser. It's running a quasi-JS runtime with PHP syntax.

To run "PHP in the browser" you'd need tests passing on all the major php frameworks, as per, Hack's testsuit. Otherwise you're forcing people to learn some language not quite either JS or PHP.

1 comments

Indeed. For this I prioritized readable and JS-like output (and no runtime) over handling things exactly. There's a different project doing it via a VM in JS: https://phpjs.hertzen.com/ and it handles most of the PHP test suite.

On the language level most stuff works well enough. However, the biggest blocker is impedance mismatch between PHP and JS environments, e.g. request-per-process vs shared server, `echo`, modules vs autoload & namespaces, etc. so even 100% accurate PHP execution is going to be doing odd things in the JS world.