I have a PHP REPL on repl.it [1] but it's admittedly not that great because certain errors are impossible to recover from, for example a call to an undefined function just kills the process. I don't know how Boris does it but I should just use it. [1]: http://repl.it/languages/PHP
I dug into his code to see how he accomplished this:
* EvalWorker is responsible for evaluating PHP expressions in forked processes *
Which is a pretty cool setup. The whole thing is nicely architected and I'm looking forward to being able to use it!