Einfache Anwendungsbeispiele
Beispiel #1 Einfache Ausführung von JavaScript
<?php$v8 = new V8Js();/* basic.js */$JS = <<< EOTlen = print('Hallo' + ' ' + 'Welt!' + "\\n");len;EOT;try { var_dump($v8->executeString($JS, 'basic.js'));} catch (V8JsException $e) { var_dump($e);}?>
Das oben gezeigte Beispiel erzeugt folgende Ausgabe:
Hallo Welt! int(12)