SunshinePHP Developer Conference 2015

Exemple

Utilizarea de bază

Example #1 Executarea de bază a unui Javascript

<?php

$v8 
= new V8Js();

/* basic.js */
$JS = <<< EOT
len = print('Hello' + ' ' + 'World!' + "\\n");
len;
EOT;

try {
  
var_dump($v8->executeString($JS'basic.js'));
} catch (
V8JsException $e) {
  
var_dump($e);
}

?>

Exemplul de mai sus va afișa:

Hello World!
int(13)
add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top