PHP-V8Js
PHP-V8Js is a PHP extension for the V8 JavaScript engine. It is a re-implementation of the fantastic (though unmaintained) V8Js PHP extension.
The extension allows you to execute JavaScript code in a secure sandbox from PHP. The executed code can be restricted using a time limit and/or memory limit. This provides the possibility to execute untrusted code with confidence.
Requirements
- PHP 8.0+
The extension includes builds of libv8, via the v8 crate. This makes installing the extension very simple.
Todo:
V8Js Compatibility
- Memory / time limits
- Snapshop creating and loading
- Default global functions
var_dump
,print
,exit
,require
- Subclassing V8Js
- Custom exceptions for
V8JsScriptException
,V8JsMemoryLimitException
andV8JsTimeLimitException
- Support for
FLAG_PROPAGATE_PHP_EXCEPTIONS
New features
- Support for native ES modules