mirror of
https://github.com/phpv8/v8js.git
synced 2024-11-08 15:48:40 +00:00
12 lines
295 B
PHP
12 lines
295 B
PHP
<?php
|
|
|
|
$a = new V8Js();
|
|
$a->func = function ($a) { echo "Closure..\n"; };
|
|
|
|
try {
|
|
$a->executeString("print(PHP.func); PHP.func(1);", "closure_test.js");
|
|
$a->executeString("print(PHP.func); PHP.func(1);", "closure_test.js");
|
|
} catch (V8JsScriptException $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|