I had that very same idea, but personally think it would be far harder to do a JavaScript VM written in pure PHP than it is to do it this way around.
doing it in pure php would be impressive (or masochistic), but there's already http://php.net/manual/en/book.v8js.php
Re:php.js - Run PHP code in JavaScript
by lucassouza1 on Wednesday July 25, 2012 @08:46AM
(#4290619)
There are great performance improvements using that. http://we-love-php.blogspot.de/2012/07/using-v8-javascript-e...
I'd go further, but from here it's really turtles all the way down.