You can pass optional arrays of predefined functions, variables, etc. to the sandbox through the constructor
public static create ( array $options = [], array $functions = [], array $variables = [], array $constants = [], array $namespaces = [], array $aliases = [], array $superglobals = [], array $magic_constants = [], array $classes = [], array $interfaces = [], array $traits = [] ) | ||
$options | array | Optional array of options to set for the sandbox |
$functions | array | Optional array of functions to define for the sandbox |
$variables | array | Optional array of variables to define for the sandbox |
$constants | array | Optional array of constants to define for the sandbox |
$namespaces | array | Optional array of namespaces to define for the sandbox |
$aliases | array | Optional array of aliases to define for the sandbox |
$superglobals | array | Optional array of superglobals to define for the sandbox |
$magic_constants | array | Optional array of magic constants to define for the sandbox |
$classes | array | Optional array of classes to define for the sandbox |
$interfaces | array | Optional array of interfaces to define for the sandbox |
$traits | array | Optional array of traits to define for the sandbox |