class Lua (View source)

Constants

LUA_VERSION

Methods

__construct(string|null $lua_script_file = null)

No description

$this|null
assign(string $name, mixed $value)

No description

mixed|false
call(callable $lua_func, array $args = [], bool $use_self = false)

No description

mixed|false
eval(string $statements)

No description

mixed|false
include(string $file)

No description

string
getVersion()

No description

$this|null|false
registerCallback(string $name, callable $function)

No description

Details

__construct(string|null $lua_script_file = null)

No description

Parameters

string|null $lua_script_file

$this|null assign(string $name, mixed $value)

No description

Parameters

string $name
mixed $value

Return Value

$this|null

Returns $this or NULL on failure.

mixed|false call(callable $lua_func, array $args = [], bool $use_self = false)

No description

Parameters

callable $lua_func

Function name in lua

array $args

Arguments passed to the Lua function

bool $use_self

Whether to use self

Return Value

mixed|false

Returns result of the called function, null for wrong arguments or FALSE on other failure.

mixed|false eval(string $statements)

No description

Parameters

string $statements

Return Value

mixed|false

Returns result of evaled code, NULL for wrong arguments or FALSE on other failure.

mixed|false include(string $file)

No description

Parameters

string $file

Return Value

mixed|false

Returns result of included code, NULL for wrong arguments or FALSE on other failure.

string getVersion()

No description

Return Value

string

Returns Lua::LUA_VERSION

$this|null|false registerCallback(string $name, callable $function)

No description

Parameters

string $name
callable $function

A valid PHP function callback

Return Value

$this|null|false

Returns $this, NULL for wrong arguments or FALSE on other failure.