LuaSandbox::wrapPhpFunction

Wrap a PHP callable in a `LuaSandboxFunction`

&reftitle.description; public `LuaSandboxFunction` `LuaSandbox::wrapPhpFunction` `callable` `function`

Wraps a PHP callable in a `LuaSandboxFunction`, so it can be passed into Lua as an anonymous function.

The function must return either an array of values (which may be empty), or &null; which is equivalent to returning the empty array.

Exceptions will be raised as errors in Lua, however only `LuaSandboxRuntimeError` exceptions may be caught inside Lua with `pcall()` or `xpcall()`.

For more information about calling Lua functions and the return values, see `LuaSandboxFunction::call`.

&reftitle.parameters;

`function`

- Callable to wrap.

&reftitle.returnvalues;

Returns a `LuaSandboxFunction`.

&reftitle.seealso;

- `LuaSandbox::loadString`
- `LuaSandbox::registerLibrary`