(PECL lua >=0.9.0)
Lua::call -- Lua::__call — 调用Lua函数
本函数还未编写文档,仅有参数列表。
lua_func
lua中的函数名。
args
向Lua函数传入的参数。
use_self
是否使用self
。
示例 #1 Lua::call()示例
<?php
$lua = new Lua();
$lua->eval(<<<CODE
function dummy(foo, bar)
print(foo, ",", bar)
end
CODE
);
$lua->call("dummy", array("Lua", "geiliable\n"));
$lua->dummy("Lua", "geiliable"); / __call()
var_dump($lua->call(array("table", "concat"), array(array(1=>1, 2=>2, 3=>3), "-")));
?>
以上示例会输出:
Lua,geiliable Lua,geiliable string(5) "1-2-3"
Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!
Check out: eBank.nz (Art Generator) |
Netwrck.com (AI Tools) |
Text-Generator.io (AI API) |
BitBank.nz (Crypto AI) |
ReadingTime (Kids Reading) |
RewordGame |
BigMultiplayerChess |
WebFiddle |
How.nz |
Helix AI Assistant