mirror of
https://github.com/phpv8/v8js.git
synced 2024-12-22 23:51:51 +00:00
34 lines
571 B
PHP
34 lines
571 B
PHP
--TEST--
|
|
Test V8::executeString() : Forcing to arrays
|
|
--SKIPIF--
|
|
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
|
|
--FILE--
|
|
<?php
|
|
|
|
$js = <<<'EOT'
|
|
var a = { 'hello' : 'world' }; a;
|
|
EOT;
|
|
|
|
$v8 = new V8Js();
|
|
|
|
try {
|
|
var_dump($v8->executeString($js, 'assoc_no_flags.js'));
|
|
echo "---\n";
|
|
var_dump($v8->executeString($js, 'assoc_force_to_array.js', V8Js::FLAG_FORCE_ARRAY));
|
|
} catch (V8JsException $e) {
|
|
var_dump($e);
|
|
}
|
|
?>
|
|
===EOF===
|
|
--EXPECT--
|
|
object(V8Object)#2 (1) {
|
|
["hello"]=>
|
|
string(5) "world"
|
|
}
|
|
---
|
|
array(1) {
|
|
["hello"]=>
|
|
string(5) "world"
|
|
}
|
|
===EOF===
|