PhpSandbox\PHPSandbox::__invoke PHP Method

__invoke() public method

Besides the code or closure to be executed, you can also pass additional arguments that will overwrite the default values of their respective arguments defined in the code
public __invoke ( Closure | callable | string $code ) : mixed
$code Closure | callable | string The closure, callable or string of code to execute
return mixed The output of the executed sandboxed code
    public function __invoke($code)
    {
        return call_user_func([$this, 'execute'], $code);
    }
PHPSandbox