编程学问
  • 文章
  • 问题
  • 读书
  • 关于
  • 登录
  • « 资源类型
  • V8Js »
  • PHP Manual
  • V8js
  • 范例

范例

Basic usage

Example #1 Basic Javascript execution

<?php

$v8 
= new V8Js();

/* basic.js */
$JS = <<< EOT
len = print('Hello' + ' ' + 'World!' + "\\n");
len;
EOT;

try {
  
var_dump($v8->executeString($JS, 'basic.js'));
} catch (
V8JsException $e) {
  
var_dump($e);
}

?>

以上例程会输出:

Hello World!
int(13)
相关文章
php v8js the v8js classphp v8js the v8jsexception classphp cubrid 函数 return the id generated for the last updated auto increment columnphp cubrid 函数 move the cursor of a lob objectphp cubrid mysql 兼容性函数 ping a server connection or reconnect if there is no connectionphp cubrid 函数 delete an element from set type column using oidphp ui 函数 retrieve font familiesphp uopz 函数 compose a classphp uopz 函数 rename a function at runtimephp v8js 简介php parle rparser dump the grammarphp 范例 lexer examplesphp 安装/配置 需求php v8js construct a new v8js objectphp v8js 范例php v8js execute a string as javascript codephp v8js return an array of registered extensionsphp v8js return pending uncaught javascript exceptionphp v8js register javascript extensions for v8jsphp v8js 安装/配置
关注编程学问公众号
编程学问网 湘ICP备20001732号