A library to integrate the Google V8 Javascript Engine in PHP
The PHP-JS library is created and maintained by Copernica.
This extension gives you the power to execute javascript right from your PHP script.
This javascript code is run through the Google V8 engine - the same engine that powers the Google Chrom(e/ium) browser and Node.js.
A basic example:
// create a new context
$context = new JS\ Context;
// execute a statement concatenating into a very well-known greeting
$result = $context->evaluate("'Hello, ' + 'world!'");
// string(13) "Hello, world!"
var_dump($result);
The full documentation is here.
Installing this library is a bit tricky, as it needs to be compiled and has two other dependencies (Google V8 Javascript engine and PHP-CPP) that also need compiling.