略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: V8Js::__construct

2024-11-14

V8Js::__construct

(PECL v8js >= 0.1.0)

V8Js::__constructConstruct a new V8Js object

说明

public V8Js::__construct(
    string $object_name = "PHP",
    array $variables = array(),
    array $extensions = array(),
    bool $report_uncaught_exceptions = true
)

Constructs a new V8Js object.

参数

object_name

The name of the object passed to Javascript.

variables

Map of PHP variables that will be available in Javascript. Must be an associative array in format array("name-for-js" => "name-of-php-variable"). Defaults to empty array.

extensions

List of extensions registered using V8Js::registerExtension() which should be available in the Javascript context of the created V8Js object.

注意:

Extensions registered to be enabled automatically do not need to be listed in this array. Also if an extension has dependencies, those dependencies can be omitted as well. Defaults to empty array.

report_uncaught_exceptions

Controls whether uncaught Javascript exceptions are reported immediately or not. Defaults to true. If set to false the uncaught exception can be accessed using V8Js::getPendingException().

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/v8js.construct.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3