CakeFest 2024: The Official CakePHP Conference

Lua::call

Lua::__call

(PECL lua >=0.9.0)

Lua::call -- Lua::__callLua 関数を呼び出す

説明

public Lua::call(callable $lua_func, array $args = ?, int $use_self = 0): mixed
public Lua::__call(callable $lua_func, array $args = ?, int $use_self = 0): mixed

警告

この関数は、 現在のところ詳細な情報はありません。引数のリストのみが 記述されています。

パラメータ

lua_func

lua での関数名

args

Lua 関数に渡される引数

use_self

self を使うか否か

戻り値

呼び出した関数の結果を返します。引数が間違っている場合は null、 それ以外のエラーの場合は false を返します。

例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"

参考

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top