LuaClosure::__invoke
PHP function
Edit on GitHub ✎
(PECL lua >=0.9.0)
Invoke luaclosure
Description
LuaClosure::__invoke(mixed ...$args): void
Func
Parameters
args
Return Values
Examples
LuaClosure::__invoke()example
php
<?php
$lua = new Lua();
$closure = $lua->eval(<<<CODE
return (function ()
print("hello world")
end)
CODE
);
$lua->call($closure);
$closure();
?>The above example will output:
output
hello worldhello world