note 128927 added to class.luasandboxfunction
| From: | npelov at croler dot net | Date: | Fri, 29 Sep 2023 16:13:14 +0000 |
| Subject: | note 128927 added to class.luasandboxfunction | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-220886@lists.php.net to get a copy of this message | ||
You can also pass function object as argument of LuaSandboxFunction::call():
$lua = new LuaSandbox();
$phpLuaFunction = $lua->wrapPhpFunction(function ($arg){
echo "LUA> ".$arg;
});
$lua->loadString("print = ...")->call($phpLuaFunction);
$lua->loadString('
print("print test from lua\\n")
')->call();
result:
LUA> print test from lua
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.157.134 (proxied: 85.11.146.60)
----
Manual Page -- https://php.net/manual/en/class.luasandboxfunction.php
Edit -- https://main.php.net/note/edit/128927
Del: integrated -- https://main.php.net/note/delete/128927/integrated
Del: useless -- https://main.php.net/note/delete/128927/useless
Del: bad code -- https://main.php.net/note/delete/128927/bad+code
Del: spam -- https://main.php.net/note/delete/128927/spam
Del: non-english -- https://main.php.net/note/delete/128927/non-english
Del: in docs -- https://main.php.net/note/delete/128927/in+docs
Del: other reasons-- https://main.php.net/note/delete/128927
Reject -- https://main.php.net/note/reject/128927
Search -- https://main.php.net/manage/user-notes.php