Results of 1 - 10 of about 13 for loadstring (0.003 sec.)
- LuaSandbox::loadString — Load Lua code into the Lua environment | PHP 8.3 14621
- LuaSandbox::loadString (PECL luasandbox >= 1.0.0) LuaSandbox::loadString — Load Lua code into the Lua environment 説明 public function LuaSandbox::loadString ( string $code , string $chunkName = '' ): LuaSandboxFunction Loads Lua code into
... the Lua environment. This is the equivalent of standard Lua's loadstring() function. パラメータ code Lua code. chunkName Name for the loaded chunk, for use in error traces. 戻り値 Returns a LuaSa ... ding code into Lua <?php // create a new LuaSandbox $sandbox = new LuaSandbox (); // Load the code $function = $sandbox -> loadString ( <<<CODE return "Hello, world" CODE ); // Execute the loaded code var_dump ( $function -> call () ); ?> 上の例の出力は以下 ...
-
https://man.mtool.work/php/8.3/luasandbox.loadstring.html
- Basic usage for LuaSandbox | PHP 8.3 9431
- 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 *
... ello, world" ); return "Hi", function ( v ) return php.frobnosticate( v + 200 ) end EOF; list( $hi , $frob ) = $sandbox -> loadString ( $luaCode )-> call (); assert ( $frob -> call ( 4000 ) === [ 4242 ] ); // PHP-thrown LuaSandboxRuntimeError exceptions ca ... n be caught inside Lua list( $ok , $message ) = $sandbox -> loadString ( 'return pcall( php.error )' )-> call (); assert ( ! $ok ); assert ( $message === 'Something is wrong' ); ?> 他のマニュア ...
-
https://man.mtool.work/php/8.3/luasandbox.examples-basic.html
- The LuaSandbox class | PHP 8.3 8920
- The LuaSandbox class (PECL luasandbox >= 1.0.0) はじめに The LuaSandbox class creates a Lua environment and allows for execution of Lua code. クラス概要 class LuaSandbox { /* 定数 */ const int SAMPLES = 0 ; const int SECONDS = 1 ; const int
... ionInfo (): array public function loadBinary ( string $code , string $chunkName = '' ): LuaSandboxFunction public function loadString ( string $code , string $chunkName = '' ): LuaSandboxFunction public function pauseUsageTimer (): bool public function reg ... rsions of LuaSandbox and Lua LuaSandbox::loadBinary — Load a precompiled binary chunk into the Lua environment LuaSandbox::loadString — Load Lua code into the Lua environment LuaSandbox::pauseUsageTimer — Pause the CPU usage timer LuaSandbox::registerLibra ...
-
https://man.mtool.work/php/8.3/class.luasandbox.html
- LuaSandbox::pauseUsageTimer — Pause the CPU usage timer | PHP 8.3 8797
- LuaSandbox::pauseUsageTimer (PECL luasandbox >= 1.4.0) LuaSandbox::pauseUsageTimer — Pause the CPU usage timer 説明 public function LuaSandbox::pauseUsageTimer (): bool Pauses the CPU usage timer. This only has effect when called from withi
... UsageTimer (); $sandbox -> unpauseUsageTimer (); doWait ( 1.1 ); } ] ); echo "This should not time out...\n" ; $sandbox -> loadString ( 'php.test()' )-> call (); echo "This should time out.\n" ; try { $sandbox -> loadString ( 'php.test2()' )-> call (); ech ...
-
https://man.mtool.work/php/8.3/luasandbox.pauseusagetimer.html
- LuaSandboxFunction::__construct — Unused | PHP 8.3 8551
- LuaSandboxFunction::__construct (PECL luasandbox >= 1.0.0) LuaSandboxFunction::__construct — Unused 説明 final private function LuaSandboxFunction::__construct () LuaSandboxFunction are obtained as a return value from Lua, as a parameter pa
... ssed to a callback from Lua, or by using LuaSandbox::wrapPhpFunction() , LuaSandbox::loadString() , or LuaSandbox::loadBinary() . They cannot be constructed directly. パラメータ この関数にはパラメータはありません。 ...
-
https://man.mtool.work/php/8.3/luasandboxfunction.construct.html
- LuaSandbox::loadBinary — Load a precompiled binary chunk into the Lua environme... 8410
- LuaSandbox::loadBinary (PECL luasandbox >= 1.0.0) LuaSandbox::loadBinary — Load a precompiled binary chunk into the Lua environment 説明 public function LuaSandbox::loadBinary ( string $code , string $chunkName = '' ): LuaSandboxFunction Lo
... uaSandboxFunction::dump() . chunkName Name for the loaded function. 戻り値 Returns a LuaSandboxFunction . 参考 LuaSandbox::loadString() - Load Lua code into the Lua environment 他のマニュアルの関連ページ Python chunk Linux JM clearenv(3) Python binary Linu ...
-
https://man.mtool.work/php/8.3/luasandbox.loadbinary.html
- The LuaSandboxFunction class | PHP 8.3 8287
- The LuaSandboxFunction class (PECL luasandbox >= 1.0.0) はじめに Represents a Lua function, allowing it to be called from PHP. A LuaSandboxFunction may be obtained as a return value from Lua, as a parameter passed to a callback from Lua, or
... by using LuaSandbox::wrapPhpFunction() , LuaSandbox::loadString() , or LuaSandbox::loadBinary() . クラス概要 class LuaSandboxFunction { /* メソッド */ public function call ( string ...$a ...
-
https://man.mtool.work/php/8.3/class.luasandboxfunction.html
- LuaSandbox::wrapPhpFunction — Wrap a PHP callable in a LuaSandboxFunction | PHP... 8164
- LuaSandbox::wrapPhpFunction (PECL luasandbox >= 1.2.0) LuaSandbox::wrapPhpFunction — Wrap a PHP callable in a LuaSandboxFunction 説明 public function LuaSandbox::wrapPhpFunction ( callable $function ): LuaSandboxFunction Wraps a PHP callabl
... LuaSandboxFunction::call() . パラメータ function Callable to wrap. 戻り値 Returns a LuaSandboxFunction . 参考 LuaSandbox::loadString() - Load Lua code into the Lua environment LuaSandbox::registerLibrary() - Register a set of PHP functions as a Lua librar ...
-
https://man.mtool.work/php/8.3/luasandbox.wrapphpfunction.html
- LuaSandbox::setMemoryLimit — Set the memory limit for the Lua environment | PHP... 8041
- LuaSandbox::setMemoryLimit (PECL luasandbox >= 1.0.0) LuaSandbox::setMemoryLimit — Set the memory limit for the Lua environment 説明 public function LuaSandbox::setMemoryLimit ( int $limit ): void Sets the memory limit for the Lua environme
... ox = new LuaSandbox (); // set a memory limit $sandbox -> setMemoryLimit ( 50 * 1024 * 1024 ); // Run Lua code $sandbox -> loadString ( 'local x = "x"; while true do x = x .. x; end' )-> call (); ?> 上の例の出力は、 たとえば以下のようになります。 PHP Fatal ...
-
https://man.mtool.work/php/8.3/luasandbox.setmemorylimit.html
- LuaSandbox::registerLibrary — Register a set of PHP functions as a Lua library ... 7777
- 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
... ng \n" ; }, 'error' => function () { throw new LuaSandboxRuntimeError ( "Something is wrong" ); } ] ); ?> 参考 LuaSandbox::loadString() - Load Lua code into the Lua environment LuaSandbox::wrapPhpFunction() - Wrap a PHP callable in a LuaSandboxFunction 他の ...
-
https://man.mtool.work/php/8.3/luasandbox.registerlibrary.html