0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-12-22 23:51:51 +00:00
phpv8/samples/test_closure.php

12 lines
295 B
PHP
Raw Normal View History

2012-04-27 16:26:15 +00:00
<?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) {
2012-04-27 16:26:15 +00:00
echo $e->getMessage(), "\n";
}