2012-04-27 16:26:15 +00:00
|
|
|
--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");
|
2013-04-13 23:36:31 +00:00
|
|
|
} catch (V8JsScriptException $e) {
|
2012-04-27 16:26:15 +00:00
|
|
|
echo $e->getMessage(), "\n";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
===EOF===
|
2020-08-21 08:10:56 +00:00
|
|
|
--EXPECTF--
|
|
|
|
[object %s]
|
2012-04-27 16:26:15 +00:00
|
|
|
Hello foobar, I'm Closure!
|
|
|
|
===EOF===
|