« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 2 of about 2 for frobnosticate (0.001 sec.)
Basic usage for LuaSandbox | PHP 8.3 11228
Basic usage for LuaSandbox Once you've compiled PHP with LuaSandbox support, you can begin using LuaSandbox to safely run user-provided Lua code. 例1 Execute some Lua code <?php $sandbox = new LuaSandbox ; $sandbox -> setMemoryLimit ( 50 * ... 1024 * 1024 ); $sandbox -> setCPULimit ( 10 ); // Register some functions in the Lua environment function frobnosticate ( $v ) { return [ $v + 42 ]; } $sandbox -> registerLibrary ( 'php' , [ 'frobnosticate' => 'frobnosticate' , 'output' => fu ... ing callbacks into PHP and into Lua $luaCode = <<<EOF php.output( "Hello, world" ); return "Hi", function ( v ) return php.frobnosticate( v + 200 ) end EOF; list( $hi , $frob ) = $sandbox -> loadString ( $luaCode )-> call (); assert ( $frob -> call ( 4000 ) = ...
https://man.mtool.work/php/8.3/luasandbox.examples-basic.html
LuaSandbox::registerLibrary — Register a set of PHP functions as a Lua library ... 7485
LuaSandbox::registerLibrary (PECL luasandbox >= 1.0.0) LuaSandbox::registerLibrary — Register a set of PHP functions as a Lua library 説明 public function LuaSandbox::registerLibrary ( string $libname , array $functions ): void Registers a ... <?php // create a new LuaSandbox $sandbox = new LuaSandbox (); // Register some functions in the Lua environment function frobnosticate ( $v ) { return [ $v + 42 ]; } $sandbox -> registerLibrary ( 'php' , [ 'frobnosticate' => 'frobnosticate' , 'output' => fu ...
https://man.mtool.work/php/8.3/luasandbox.registerlibrary.html
PREV 1 NEXT