编程学问
  • 文章
  • 问题
  • 读书
  • 关于
  • 登录
  • « 资源类型
  • 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 classkit 函数 dynamically changes the name of the given methodphp commonmark 函数 renderingphp crack 函数 returns the message from the last obscure checkphp cubrid mysql 兼容性函数 return the number of rows affected by the last sql statementphp trader 函数 hilbert transform instantaneous trendlinephp trader 函数 index of highest value over a specified periodphp trader 函数 plus directional movementphp v8js 简介php 预定义常量 非对称加密的填充标志php 安装/配置 运行时配置php parallel events pollingphp 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号