mirror of
https://github.com/phpv8/v8js.git
synced 2024-11-09 16:28:41 +00:00
22 lines
455 B
PHP
22 lines
455 B
PHP
--TEST--
|
|
Test V8::executeString() : Simple test
|
|
--SKIPIF--
|
|
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
|
|
--FILE--
|
|
<?php
|
|
|
|
$a = new V8Js();
|
|
$a->func = function ($arg) { echo "Hello {$arg}, I'm Closure!\n"; };
|
|
|
|
try {
|
|
$a->executeString('print(PHP.func + "\n"); PHP.func("foobar");', "closure_test.js");
|
|
} catch (V8JsScriptException $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
?>
|
|
===EOF===
|
|
--EXPECTF--
|
|
[object %s]
|
|
Hello foobar, I'm Closure!
|
|
===EOF===
|