Menu

## PHPSandbox
in package
implements IteratorAggregate

PHPSandbox.php : 290

PHPSandbox class for PHP Sandboxes.

This class encapsulates the entire functionality of a PHPSandbox so that an end user only has to create a PHPSandbox instance, configure its options, and run their code

##### Tags

namespace

  PHPSandbox

author

  Elijah Horton elijah@corveda.com

version
  3.0

### Interfaces, Classes and Traits

IteratorAggregate

### Table of Contents

IMPORT_ALL = 0
IMPORT_BLACKLIST = 8
IMPORT_CODE = 32
IMPORT_DEFINITIONS = 2
IMPORT_OPTIONS = 1
IMPORT_TRUSTED_CODE = 16
IMPORT_WHITELIST = 4
SANDBOX_PREFIX = '__PHPSandbox_'
$allow_aliases : bool
$allow_backticks : bool
$allow_casting : bool
$allow_classes : bool
$allow_closures : bool
$allow_constants : bool
$allow_error_suppressing : bool
$allow_escaping : bool
$allow_functions : bool
$allow_generators : bool
$allow_globals : bool
$allow_halting : bool
$allow_includes : bool
$allow_interfaces : bool
$allow_namespaces : bool
$allow_objects : bool
$allow_references : bool
$allow_static_variables : bool
$allow_traits : bool
$allow_variables : bool
$arg_funcs : array<string|int, mixed>
$auto_define_vars : bool
$auto_whitelist_classes : bool
$auto_whitelist_constants : bool
$auto_whitelist_functions : bool
$auto_whitelist_globals : bool
$auto_whitelist_interfaces : bool
$auto_whitelist_traits : bool
$auto_whitelist_trusted_code : bool
$capture_output : bool
$convert_errors : bool
$defined_funcs : array<string|int, mixed>
$error_level : int|null
$magic_constants : array<string|int, mixed>
$name : string
$overwrite_defined_funcs : bool
$overwrite_func_get_args : bool
$overwrite_sandboxed_string_funcs : bool
$overwrite_superglobals : bool
$restore_error_level : bool
$sandbox_includes : bool
$sandbox_strings : bool
$sandboxed_string_funcs : array<string|int, mixed>
$superglobals : array<string|int, mixed>
$time_limit : int
$validate_aliases : bool
$validate_classes : bool
$validate_constants : bool
$validate_functions : bool
$validate_globals : bool
$validate_interfaces : bool
$validate_keywords : bool
$validate_magic_constants : bool
$validate_namespaces : bool
$validate_operators : bool
$validate_primitives : bool
$validate_superglobals : bool
$validate_traits : bool
$validate_types : bool
$validate_variables : bool
$appended_code : string
$blacklist : array<string|int, mixed>
$definitions : array<string|int, mixed>
$error_handler : callable|null
$error_handler_types : int
$exception_handler : callable|null
$executing_file : string|null
$execution_time : float
$generated_code : string
$includes : array<string|int, mixed>
$last_error : array<string|int, mixed>|null
$last_exception : Throwable|null
$last_validation_error : Throwable|null
$memory_usage : int
$parsed_ast : array<string|int, mixed>
$prepare_time : float
$prepared_ast : array<string|int, mixed>
$prepared_code : string
$preparsed_code : string
$prepended_code : string
$sandboxes : array<string|int, mixed>
$validation : array<string|int, mixed>
$validation_error_handler : callable|null
$whitelist : array<string|int, mixed>
__call() : mixed
  Magic method to provide API compatibility for v1.* code
__construct() : mixed
  PHPSandbox class constructor
__invoke() : mixed
  PHPSandbox __invoke magic method
__sleep() : array<string|int, mixed>
  PHPSandbox __sleep magic method
_array_key_exists() : bool
  Get PHPSandbox redefined array_key_exists
_arrayval() : array<string|int, mixed>
  Return array value of SandboxedString or mixed value
_boolval() : bool
  Return boolean value of SandboxedString or mixed value
_floatval() : float
  Return float value of SandboxedString or mixed value
_func_get_arg() : mixed
  Get PHPSandbox redefined function argument
_func_get_args() : array<string|int, mixed>
  Get PHPSandbox redefined function arguments array
_func_num_args() : int
  Get PHPSandbox redefined number of function arguments
_get_declared_classes() : array<string|int, mixed>
  Get PHPSandbox redefined classes in place of get_declared_classes(). This is an internal PHPSandbox function but requires public access to work.
_get_declared_interfaces() : array<string|int, mixed>
  Get PHPSandbox redefined interfaces in place of get_declared_interfaces(). This is an internal PHPSandbox function but requires public access to work.
_get_declared_traits() : array<string|int, mixed>
  Get PHPSandbox redefined traits in place of get_declared_traits(). This is an internal PHPSandbox function but requires public access to work.
_get_defined_constants() : array<string|int, mixed>
  Get PHPSandbox redefined constants in place of get_defined_constants(). This is an internal PHPSandbox function but requires public access to work.
_get_defined_functions() : array<string|int, mixed>
  Get PHPSandbox redefined functions in place of get_defined_functions(). This is an internal PHPSandbox function but requires public access to work.
_get_defined_vars() : array<string|int, mixed>
  Get PHPSandbox redefined variables in place of get_defined_vars(). This is an internal PHPSandbox function but requires public access to work.
_get_included_files() : array<string|int, mixed>
  Return get_included_files() and sandboxed included files
_get_magic_const() : mixed
  Get PHPSandbox redefined magic constant. This is an internal PHPSandbox function but requires public access to work.
_get_superglobal() : array<string|int, mixed>
  Get PHPSandbox redefined superglobal. This is an internal PHPSandbox function but requires public access to work.
_include() : mixed
  Sandbox included file
_include_once() : mixed
  Sandbox included once file
_intval() : int
  Return integer value of SandboxedString or mixed value
_is_callable() : bool
  Return is_callable value of SandboxedString or mixed value
_is_object() : bool
  Return is_object value of SandboxedString or mixed value
_is_scalar() : bool
  Return is_scalar value of SandboxedString or mixed value
_is_string() : bool
  Return is_string value of SandboxedString or mixed value
_objectval() : object
  Return object value of SandboxedString or mixed value
_print_r() : bool|string
  Get PHPSandbox redefined print_r
_require() : mixed
  Sandbox required file
_require_once() : mixed
  Sandbox required once file
_var_dump() : void
  Get PHPSandbox redefined var_dump
_var_export() : string|null
  Get PHPSandbox redefined var_export
append() : PHPSandbox
  Append trusted code
auto_define() :
auto_whitelist() :
blacklist() : PHPSandbox
  Blacklist PHPSandbox definitions, such as functions, constants, classes, etc. to set
blacklist_alias() :
blacklist_class() :
blacklist_const() :
blacklist_func() :
blacklist_global() :
blacklist_interface() :
blacklist_keyword() :
blacklist_magic_const() :
blacklist_namespace() :
blacklist_operator() :
blacklist_primitive() :
blacklist_superglobal() :
blacklist_trait() :
blacklist_type() :
blacklist_use() :
blacklist_var() :
blacklistAlias() : PHPSandbox
  Blacklist alias
blacklistClass() : PHPSandbox
  Blacklist class
blacklistConst() : PHPSandbox
  Blacklist constant
blacklistFunc() : PHPSandbox
  Blacklist function
blacklistGlobal() : PHPSandbox
  Blacklist global
blacklistInterface() : PHPSandbox
  Blacklist interface
blacklistKeyword() : PHPSandbox
  Blacklist keyword
blacklistMagicConst() : PHPSandbox
  Blacklist magic constant
blacklistNamespace() : PHPSandbox
  Blacklist namespace
blacklistOperator() : PHPSandbox
  Blacklist operator
blacklistPrimitive() : PHPSandbox
  Blacklist primitive
blacklistSuperglobal() : PHPSandbox
  Blacklist superglobal or superglobal key * You can pass a string of the superglobal name, or a string of the superglobal name and a string of the key, or pass an array of superglobal names, or an associative array of superglobal names and their keys to blacklist
blacklistTrait() : PHPSandbox
  Blacklist trait
blacklistType() : PHPSandbox
  Blacklist type
blacklistUse() : PHPSandbox
  Blacklist use (or alias)
blacklistVar() : PHPSandbox
  Blacklist variable
call_func() : mixed
  Get PHPSandbox redefined function. This is an internal PHPSandbox function but requires public access to work.
check_alias() :
check_class() :
check_const() :
check_func() :
check_global() :
check_interface() :
check_keyword() :
check_magic_const() :
check_namespace() :
check_operator() :
check_primitive() :
check_superglobal() :
check_trait() :
check_type() :
check_use() :
check_var() :
checkAlias() : bool
  Check alias name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.
checkClass() : bool
  Check class name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.
checkConst() : bool
  Check constant name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.
checkFunc() : bool
  Check function name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.
checkGlobal() : bool
  Check global name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.
checkInterface() : bool
  Check interface name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.
checkKeyword() : bool
  Check keyword name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.
checkMagicConst() : bool
  Check magic constant name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.
checkNamespace() : bool
  Check namespace name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.
checkOperator() : bool
  Check operator name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.
checkPrimitive() : bool
  Check primitive name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.
checkSuperglobal() : bool
  Check superglobal name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.
checkTrait() : bool
  Check trait name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.
checkType() : bool
  Check type name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.
checkUse() : bool
  Check use (or alias) name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.
checkVar() : bool
  Check variable name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.
clear() : PHPSandbox
  Clear all trusted and sandboxed code
clear_append() :
clear_code() :
clear_prepend() :
clear_trusted_code() :
clearAppend() : PHPSandbox
  Clear all appended trusted code
clearAppendedCode() : PHPSandbox
  Clear all appended trusted code
clearCode() : PHPSandbox
  Clear generated code
clearPrepended() : PHPSandbox
  Clear all prepended trusted code
clearPrependedCode() : PHPSandbox
  Clear all prepended trusted code
clearTrustedCode() : PHPSandbox
  Clear all trusted code
create() : PHPSandbox
  PHPSandbox static factory method
deblacklist() : PHPSandbox
  Remove PHPSandbox definitions, such as functions, constants, classes, etc. from blacklist
deblacklist_alias() :
deblacklist_class() :
deblacklist_const() :
deblacklist_func() :
deblacklist_global() :
deblacklist_interface() :
deblacklist_keyword() :
deblacklist_magic_const() :
deblacklist_namespace() :
deblacklist_operator() :
deblacklist_primitive() :
deblacklist_superglobal() :
deblacklist_trait() :
deblacklist_type() :
deblacklist_use() :
deblacklist_var() :
deblacklistAlias() : PHPSandbox
  Remove alias from blacklist
deblacklistClass() : PHPSandbox
  Remove class from blacklist
deblacklistConst() : PHPSandbox
  Remove constant from blacklist
deblacklistFunc() : PHPSandbox
  Remove function from blacklist
deblacklistGlobal() : PHPSandbox
  Remove global from blacklist
deblacklistInterface() : PHPSandbox
  Remove interface from blacklist
deblacklistKeyword() : PHPSandbox
  Remove keyword from blacklist
deblacklistMagicConst() : PHPSandbox
  Remove magic constant from blacklist
deblacklistNamespace() : PHPSandbox
  Remove namespace from blacklist
deblacklistOperator() : PHPSandbox
  Remove operator from blacklist
deblacklistPrimitive() : PHPSandbox
  Remove primitive from blacklist
deblacklistSuperglobal() : PHPSandbox
  Remove superglobal or superglobal key from blacklist * You can pass a string of the superglobal name, or a string of the superglobal name and a string of the key, or pass an array of superglobal names, or an associative array of superglobal names and their keys to remove from blacklist
deblacklistTrait() : PHPSandbox
  Remove trait from blacklist
deblacklistType() : PHPSandbox
  Remove type from blacklist
deblacklistUse() : PHPSandbox
  Remove use (or alias) from blacklist
deblacklistVar() : PHPSandbox
  Remove function from blacklist
define() : PHPSandbox
  Define PHPSandbox definitions, such as functions, constants, namespaces, etc.
define_alias() :
define_aliases() :
define_class() :
define_classes() :
define_const() :
define_consts() :
define_func() :
define_funcs() :
define_interface() :
define_interfaces() :
define_magic_const() :
define_magic_consts() :
define_namespace() :
define_namespaces() :
define_superglobal() :
define_superglobals() :
define_trait() :
define_traits() :
define_use() :
define_uses() :
define_var() :
define_vars() :
defineAlias() : PHPSandbox
  Define PHPSandbox alias
defineAliases() : PHPSandbox
  Define PHPSandbox aliases by array
defineClass() : PHPSandbox
  Define PHPSandbox class
defineClasses() : PHPSandbox
  Define PHPSandbox classes by array
defineConst() : PHPSandbox
  Define PHPSandbox constant
defineConsts() : PHPSandbox
  Define PHPSandbox constants by array
defineFunc() : PHPSandbox
  Define PHPSandbox function
defineFuncs() : PHPSandbox
  Define PHPSandbox functions by array
defineInterface() : PHPSandbox
  Define PHPSandbox interface
defineInterfaces() : PHPSandbox
  Define PHPSandbox interfaces by array
defineMagicConst() : PHPSandbox
  Define PHPSandbox magic constant
defineMagicConsts() : PHPSandbox
  Define PHPSandbox magic constants by array
defineNamespace() : PHPSandbox
  Define PHPSandbox namespace
defineNamespaces() : PHPSandbox
  Define PHPSandbox namespaces by array
defineSuperglobal() : PHPSandbox
  Define PHPSandbox superglobal
defineSuperglobals() : PHPSandbox
  Define PHPSandbox superglobals by array
defineTrait() : PHPSandbox
  Define PHPSandbox trait
defineTraits() : PHPSandbox
  Define PHPSandbox traits by array
defineUse() : PHPSandbox
  Define PHPSandbox use (or alias)
defineUses() : PHPSandbox
  Define PHPSandbox uses (or aliases) by array
defineVar() : PHPSandbox
  Define PHPSandbox variable
defineVars() : PHPSandbox
  Define PHPSandbox variables by array
dewhitelist() : PHPSandbox
  Remove PHPSandbox definitions, such as functions, constants, classes, etc. from whitelist
dewhitelist_alias() :
dewhitelist_class() :
dewhitelist_const() :
dewhitelist_func() :
dewhitelist_global() :
dewhitelist_interface() :
dewhitelist_keyword() :
dewhitelist_magic_const() :
dewhitelist_namespace() :
dewhitelist_operator() :
dewhitelist_primitive() :
dewhitelist_superglobal() :
dewhitelist_trait() :
dewhitelist_type() :
dewhitelist_use() :
dewhitelist_var() :
dewhitelistAlias() : PHPSandbox
  Remove alias from whitelist
dewhitelistClass() : PHPSandbox
  Remove class from whitelist
dewhitelistConst() : PHPSandbox
  Remove constant from whitelist
dewhitelistFunc() : PHPSandbox
  Remove function from whitelist
dewhitelistGlobal() : PHPSandbox
  Remove global from whitelist
dewhitelistInterface() : PHPSandbox
  Remove interface from whitelist
dewhitelistKeyword() : PHPSandbox
  Remove keyword from whitelist
dewhitelistMagicConst() : PHPSandbox
  Remove magic constant from whitelist
dewhitelistNamespace() : PHPSandbox
  Remove namespace from whitelist
dewhitelistOperator() : PHPSandbox
  Remove operator from whitelist
dewhitelistPrimitive() : PHPSandbox
  Remove primitive from whitelist
dewhitelistSuperglobal() : PHPSandbox
  Remove superglobal or superglobal key from whitelist * You can pass a string of the superglobal name, or a string of the superglobal name and a string of the key, or pass an array of superglobal names, or an associative array of superglobal names and their keys to remove from whitelist
dewhitelistTrait() : PHPSandbox
  Remove trait from whitelist
dewhitelistType() : PHPSandbox
  Remove type from whitelist
dewhitelistUse() : PHPSandbox
  Remove use (or alias) from whitelist
dewhitelistVar() : PHPSandbox
  Remove variable from whitelist
error() : mixed
  Invoke sandbox error handler
exception() : mixed
  Invoke sandbox exception handler
execute() : mixed
  Prepare and execute callable and return output
get_defined_class() :
get_defined_interface() :
get_defined_namespace() :
get_defined_trait() :
get_error_handler() :
get_exception_handler() :
get_execution_time() :
get_last_error() :
get_last_exception() :
get_last_validation_error() :
get_prepared_time() :
get_time() :
get_validation_error_handler() :
getAliasValidator() : callable|null
  Get validation callable for aliases
getAppendedCode() : string
  Get PHPSandbox appended code
getClassValidator() : callable|null
  Get validation callable for classes
getCode() : string
  Get PHPSandbox generated code
getConstValidator() : callable|null
  Get validation callable for constants
getDefinedClass() : string
  Get defined class of $name
getDefinedInterface() : string
  Get defined interface of $name
getDefinedNamespace() : string
  Get defined namespace of $name
getDefinedTrait() : string
  Get defined trait of $name
getErrorHandler() : callable|null
  Get error handler
getExceptionHandler() : callable|null
  Get exception handler
getExecutingFile() : string|null
  Return the current file being executed in the sandbox
getExecutionTime() : float
  Return the amount of time the sandbox spent executing the sandboxed code
getFuncValidator() : callable|null
  Get validation for functions
getGeneratedCode() : string
  Get PHPSandbox generated code
getGlobalValidator() : callable|null
  Get validation callable for globals
getInterfaceValidator() : callable|null
  Get validation callable for interfaces
getIterator() : ArrayIterator
  Get an iterator of all the public PHPSandbox properties
getKeywordValidator() : callable|null
  Get validation callable for keywords
getLastError() : array<string|int, mixed>|null
  Gets the last sandbox error
getLastException() : Throwable|null
  Gets the last exception thrown by the sandbox
getLastValidationError() : Throwable|null
  Gets the last validation error thrown by the sandbox
getMagicConstValidator() : callable|null
  Get validation callable for magic constants
getMemoryUsage() : float
  Return the amount of bytes the sandbox allocated while preparing and executing the sandboxed code
getName() : string
  Get name of PHPSandbox variable
getNamespaceValidator() : callable|null
  Get validation callable for namespaces
getOperatorValidator() : callable|null
  Get validation callable for operators
getOption() : bool|int|null
  Get PHPSandbox option
getParsedAST() : array<string|int, mixed>
  Get PHPSandbox parsed AST array
getPreparedAST() : array<string|int, mixed>
  Get PHPSandbox prepared AST array
getPreparedCode() : string
  Get PHPSandbox prepared code
getPreparedTime() : float
  Return the amount of time the sandbox spent preparing the sandboxed code
getPreparsedCode() : string
  Get PHPSandbox preparsed code
getPrependedCode() : string
  Get PHPSandbox prepended code
getPrimitiveValidator() : callable|null
  Get validation callable for primitives
getSandbox() : PHPSandbox|null
  Get a named PHPSandbox instance (used to retrieve the sandbox instance from within sandboxed code)
getSuperglobalValidator() : callable|null
  Get validation callable for superglobals
getTime() : float
  Return the amount of time the sandbox spent preparing and executing the sandboxed code
getTraitValidator() : callable|null
  Get validation callable for traits
getTypeValidator() : callable|null
  Get validation callable for types
getUseValidator() : callable|null
  Get validation callable for uses (aka aliases)
getValidationErrorHandler() : callable|null
  Get validation error handler
getValidator() : callable|null
  Get validation callable for specified $type
getVarValidator() : callable|null
  Get validation callable for variables
has_blacklist() :
has_blacklist_aliases() :
has_blacklist_classes() :
has_blacklist_consts() :
has_blacklist_funcs() :
has_blacklist_globals() :
has_blacklist_interfaces() :
has_blacklist_keywords() :
has_blacklist_magic_consts() :
has_blacklist_namespaces() :
has_blacklist_operators() :
has_blacklist_primitives() :
has_blacklist_superglobals() :
has_blacklist_traits() :
has_blacklist_types() :
has_blacklist_uses() :
has_blacklist_vars() :
has_defined_aliases() :
has_defined_classes() :
has_defined_consts() :
has_defined_funcs() :
has_defined_interfaces() :
has_defined_magic_consts() :
has_defined_namespaces() :
has_defined_superglobals() :
has_defined_traits() :
has_defined_uses() :
has_defined_vars() :
has_whitelist() :
has_whitelist_aliases() :
has_whitelist_classes() :
has_whitelist_consts() :
has_whitelist_funcs() :
has_whitelist_globals() :
has_whitelist_interfaces() :
has_whitelist_keywords() :
has_whitelist_magic_consts() :
has_whitelist_namespaces() :
has_whitelist_operators() :
has_whitelist_primitives() :
has_whitelist_superglobals() :
has_whitelist_traits() :
has_whitelist_types() :
has_whitelist_uses() :
has_whitelist_vars() :
hasBlacklist() : int
  Query whether PHPSandbox instance has blacklist type.
hasBlacklistedAliases() : int
  Query whether PHPSandbox instance has blacklisted aliases.
hasBlacklistedClasses() : int
  Query whether PHPSandbox instance has blacklisted classes.
hasBlacklistedConsts() : int
  Query whether PHPSandbox instance has blacklisted constants.
hasBlacklistedFuncs() : int
  Query whether PHPSandbox instance has blacklisted functions.
hasBlacklistedGlobals() : int
  Query whether PHPSandbox instance has blacklisted globals.
hasBlacklistedInterfaces() : int
  Query whether PHPSandbox instance has blacklisted interfaces.
hasBlacklistedKeywords() : int
  Query whether PHPSandbox instance has blacklisted keywords.
hasBlacklistedMagicConsts() : int
  Query whether PHPSandbox instance has blacklisted magic constants.
hasBlacklistedNamespaces() : int
  Query whether PHPSandbox instance has blacklisted namespaces.
hasBlacklistedOperators() : int
  Query whether PHPSandbox instance has blacklisted operators.
hasBlacklistedPrimitives() : int
  Query whether PHPSandbox instance has blacklisted primitives.
hasBlacklistedSuperglobals() : int
  Query whether PHPSandbox instance has blacklisted superglobals, or superglobal keys
hasBlacklistedTraits() : int
  Query whether PHPSandbox instance has blacklisted traits.
hasBlacklistedTypes() : int
  Query whether PHPSandbox instance has blacklisted types.
hasBlacklistedUses() : int
  Query whether PHPSandbox instance has blacklisted uses (or aliases.)
hasBlacklistedVars() : int
  Query whether PHPSandbox instance has blacklisted variables.
hasDefinedAliases() : int
  Query whether PHPSandbox instance has defined aliases
hasDefinedClasses() : int
  Query whether PHPSandbox instance has defined classes
hasDefinedConsts() : int
  Query whether PHPSandbox instance has defined constants
hasDefinedFuncs() : int
  Query whether PHPSandbox instance has defined functions
hasDefinedInterfaces() : int
  Query whether PHPSandbox instance has defined interfaces
hasDefinedMagicConsts() : int
  Query whether PHPSandbox instance has defined magic constants
hasDefinedNamespaces() : int
  Query whether PHPSandbox instance has defined namespaces
hasDefinedSuperglobals() : int
  Query whether PHPSandbox instance has defined superglobals, or if superglobal $name has defined keys
hasDefinedTraits() : int
  Query whether PHPSandbox instance has defined traits
hasDefinedUses() : int
  Query whether PHPSandbox instance has defined uses (or aliases)
hasDefinedVars() : int
  Query whether PHPSandbox instance has defined variables
hasWhitelist() : int
  Query whether PHPSandbox instance has whitelist type
hasWhitelistedAliases() : int
  Query whether PHPSandbox instance has whitelisted aliases.
hasWhitelistedClasses() : int
  Query whether PHPSandbox instance has whitelisted classes.
hasWhitelistedConsts() : int
  Query whether PHPSandbox instance has whitelisted constants.
hasWhitelistedFuncs() : int
  Query whether PHPSandbox instance has whitelisted functions.
hasWhitelistedGlobals() : int
  Query whether PHPSandbox instance has whitelisted globals.
hasWhitelistedInterfaces() : int
  Query whether PHPSandbox instance has whitelisted interfaces.
hasWhitelistedMagicConsts() : int
  Query whether PHPSandbox instance has whitelisted magic constants.
hasWhitelistedNamespaces() : int
  Query whether PHPSandbox instance has whitelisted namespaces.
hasWhitelistedOperators() : int
  Query whether PHPSandbox instance has whitelisted operators.
hasWhitelistedPrimitives() : int
  Query whether PHPSandbox instance has whitelisted primitives.
hasWhitelistedSuperglobals() : int
  Query whether PHPSandbox instance has whitelisted superglobals, or superglobal keys
hasWhitelistedTraits() : int
  Query whether PHPSandbox instance has whitelisted traits.
hasWhitelistedTypes() : int
  Query whether PHPSandbox instance has whitelisted types.
hasWhitelistedUses() : int
  Query whether PHPSandbox instance has whitelisted uses (or aliases.)
hasWhitelistedVars() : int
  Query whether PHPSandbox instance has whitelisted variables.
hasWhitelistKeywords() : int
  Query whether PHPSandbox instance has whitelisted keywords.
import() : PHPSandbox
  PHPSandbox __wakeup magic method
importJSON() : PHPSandbox
  Import JSON template into sandbox
is_blacklisted() :
is_blacklisted_alias() :
is_blacklisted_class() :
is_blacklisted_const() :
is_blacklisted_func() :
is_blacklisted_global() :
is_blacklisted_interface() :
is_blacklisted_keyword() :
is_blacklisted_magic_const() :
is_blacklisted_namespace() :
is_blacklisted_operator() :
is_blacklisted_primitive() :
is_blacklisted_superglobal() :
is_blacklisted_trait() :
is_blacklisted_type() :
is_blacklisted_use() :
is_blacklisted_var() :
is_defined_alias() :
is_defined_class() :
is_defined_const() :
is_defined_func() :
is_defined_interface() :
is_defined_magic_const() :
is_defined_namespace() :
is_defined_superglobal() :
is_defined_trait() :
is_defined_use() :
is_defined_var() :
is_whitelisted() :
is_whitelisted_alias() :
is_whitelisted_class() :
is_whitelisted_const() :
is_whitelisted_func() :
is_whitelisted_global() :
is_whitelisted_interface() :
is_whitelisted_keyword() :
is_whitelisted_magic_const() :
is_whitelisted_namespace() :
is_whitelisted_operator() :
is_whitelisted_primitive() :
is_whitelisted_superglobal() :
is_whitelisted_trait() :
is_whitelisted_type() :
is_whitelisted_use() :
is_whitelisted_var() :
isBlacklisted() : bool
  Check if PHPSandbox instance has blacklist type and name set
isBlacklistedAlias() : bool
  Check if PHPSandbox instance has blacklisted alias name set
isBlacklistedClass() : bool
  Check if PHPSandbox instance has blacklisted class name set
isBlacklistedConst() : bool
  Check if PHPSandbox instance has blacklisted constant name set
isBlacklistedFunc() : bool
  Check if PHPSandbox instance has blacklisted function name set
isBlacklistedGlobal() : bool
  Check if PHPSandbox instance has blacklisted global name set
isBlacklistedInterface() : bool
  Check if PHPSandbox instance has blacklisted interface name set
isBlacklistedKeyword() : bool
  Check if PHPSandbox instance has blacklisted keyword name set
isBlacklistedMagicConst() : bool
  Check if PHPSandbox instance has blacklisted magic constant name set
isBlacklistedNamespace() : bool
  Check if PHPSandbox instance has blacklisted namespace name set
isBlacklistedOperator() : bool
  Check if PHPSandbox instance has blacklisted operator name set
isBlacklistedPrimitive() : bool
  Check if PHPSandbox instance has blacklisted primitive name set
isBlacklistedSuperglobal() : bool
  Check if PHPSandbox instance has blacklisted superglobal or superglobal key set
isBlacklistedTrait() : bool
  Check if PHPSandbox instance has blacklisted trait name set
isBlacklistedType() : bool
  Check if PHPSandbox instance has blacklisted type name set
isBlacklistedUse() : bool
  Check if PHPSandbox instance has blacklisted use (or alias) name set
isBlacklistedVar() : bool
  Check if PHPSandbox instance has blacklisted variable name set
isDefinedAlias() : bool
  Check if PHPSandbox instance has $name alias defined
isDefinedClass() : bool
  Check if PHPSandbox instance has $name class defined
isDefinedConst() : bool
  Check if PHPSandbox instance has $name constant defined
isDefinedFunc() : bool
  Check if PHPSandbox instance has $name function defined
isDefinedInterface() : bool
  Check if PHPSandbox instance has $name interface defined
isDefinedMagicConst() : bool
  Check if PHPSandbox instance has $name magic constant defined
isDefinedNamespace() : bool
  Check if PHPSandbox instance has $name namespace defined
isDefinedSuperglobal() : bool
  Check if PHPSandbox instance has $name superglobal defined, or if superglobal $name key is defined
isDefinedTrait() : bool
  Check if PHPSandbox instance has $name trait defined
isDefinedUse() : bool
  Check if PHPSandbox instance has $name uses (or alias) defined
isDefinedVar() : bool
  Check if PHPSandbox instance has $name variable defined
isWhitelisted() : bool
  Check if PHPSandbox instance has whitelist type and name set
isWhitelistedAlias() : bool
  Check if PHPSandbox instance has whitelisted alias name set
isWhitelistedClass() : bool
  Check if PHPSandbox instance has whitelisted class name set
isWhitelistedConst() : bool
  Check if PHPSandbox instance has whitelisted constant name set
isWhitelistedFunc() : bool
  Check if PHPSandbox instance has whitelisted function name set
isWhitelistedGlobal() : bool
  Check if PHPSandbox instance has whitelisted global name set
isWhitelistedInterface() : bool
  Check if PHPSandbox instance has whitelisted interface name set
isWhitelistedKeyword() : bool
  Check if PHPSandbox instance has whitelisted keyword name set
isWhitelistedMagicConst() : bool
  Check if PHPSandbox instance has whitelisted magic constant name set
isWhitelistedNamespace() : bool
  Check if PHPSandbox instance has whitelisted namespace name set
isWhitelistedOperator() : bool
  Check if PHPSandbox instance has whitelisted operator name set
isWhitelistedPrimitive() : bool
  Check if PHPSandbox instance has whitelisted primitive name set
isWhitelistedSuperglobal() : bool
  Check if PHPSandbox instance has whitelisted superglobal or superglobal key set
isWhitelistedTrait() : bool
  Check if PHPSandbox instance has whitelisted trait name set
isWhitelistedType() : bool
  Check if PHPSandbox instance has whitelisted type name set
isWhitelistedUse() : bool
  Check if PHPSandbox instance has whitelisted use (or alias) name set
isWhitelistedVar() : bool
  Check if PHPSandbox instance has whitelisted variable name set
normalize_alias() :
normalize_class() :
normalize_func() :
normalize_interface() :
normalize_keyword() :
normalize_magic_const() :
normalize_namespace() :
normalize_operator() :
normalize_primitive() :
normalize_superglobal() :
normalize_trait() :
normalize_type() :
normalize_use() :
prepare() : string
  Prepare passed callable for execution
prepare_aliases() :
prepare_consts() :
prepare_namespaces() :
prepare_uses() :
prepare_vars() :
prepend() : PHPSandbox
  Prepend trusted code
resetOptions() : PHPSandbox
  Reset PHPSandbox options to their default values
set_error_handler() :
set_exception_handler() :
set_validation_error_handler() :
setAliasValidator() : PHPSandbox
  Set validation callable for aliases
setAppendedCode() : PHPSandbox
  Set PHPSandbox appended code
setClassValidator() : PHPSandbox
  Set validation callable for classes
setCode() : PHPSandbox
  Set PHPSandbox generated code
setConstValidator() : PHPSandbox
  Set validation callable for constants
setErrorHandler() : PHPSandbox
  Set callable to handle errors
setExceptionHandler() : PHPSandbox
  Set callable to handle thrown exceptions
setExecutingFile() : PHPSandbox
  Set the currently executing filepath
setFuncValidator() : PHPSandbox
  Set validation callable for functions
setGeneratedCode() : PHPSandbox
  Set PHPSandbox generated code
setGlobalValidator() : PHPSandbox
  Set validation callable for globals
setInterfaceValidator() : PHPSandbox
  Set validation callable for interfaces
setKeywordValidator() : PHPSandbox
  Set validation callable for keywords
setMagicConstValidator() : PHPSandbox
  Set validation callable for magic constants
setNamespaceValidator() : PHPSandbox
  Set validation callable for namespaces
setOperatorValidator() : PHPSandbox
  Set validation callable for operators
setOption() : PHPSandbox
  Set PHPSandbox option
setOptions() : PHPSandbox
  Set PHPSandbox options by array
setParsedAST() : PHPSandbox
  Set PHPSandbox parsed AST array
setPreparedAST() : PHPSandbox
  Set PHPSandbox prepared AST array
setPreparedCode() : PHPSandbox
  Set PHPSandbox prepared code
setPreparsedCode() : PHPSandbox
  Set PHPSandbox preparsed code
setPrependedCode() : PHPSandbox
  Set PHPSandbox prepended code
setPrimitiveValidator() : PHPSandbox
  Set validation callable for primitives
setSuperglobalValidator() : PHPSandbox
  Set validation callable for superglobals
setTraitValidator() : PHPSandbox
  Set validation callable for traits
setTypeValidator() : PHPSandbox
  Set validation callable for types
setUseValidator() : PHPSandbox
  Set validation callable for uses (aka aliases)
setValidationErrorHandler() : PHPSandbox
  Set callable to handle thrown validation Errors
setValidator() : PHPSandbox
  Set validation callable for specified $type
setVarValidator() : PHPSandbox
  Set validation callable for variables
undefine() : PHPSandbox
  Undefine PHPSandbox definitions, such as functions, constants, namespaces, etc.
undefine_alias() :
undefine_aliases() :
undefine_class() :
undefine_classes() :
undefine_const() :
undefine_consts() :
undefine_func() :
undefine_funcs() :
undefine_interface() :
undefine_interfaces() :
undefine_magic_const() :
undefine_magic_consts() :
undefine_namespace() :
undefine_namespaces() :
undefine_superglobal() :
undefine_superglobals() :
undefine_trait() :
undefine_traits() :
undefine_use() :
undefine_uses() :
undefine_var() :
undefine_vars() :
undefineAlias() : PHPSandbox
  Undefine PHPSandbox alias
undefineAliases() : PHPSandbox
  Undefine PHPSandbox aliases by array
undefineClass() : PHPSandbox
  Undefine PHPSandbox class
undefineClasses() : PHPSandbox
  Undefine PHPSandbox classes by array
undefineConst() : PHPSandbox
  Undefine PHPSandbox constant
undefineConsts() : PHPSandbox
  Undefine PHPSandbox constants by array
undefineFunc() : PHPSandbox
  Undefine PHPSandbox function
undefineFuncs() : PHPSandbox
  Undefine PHPSandbox functions by array
undefineInterface() : PHPSandbox
  Undefine PHPSandbox interface
undefineInterfaces() : PHPSandbox
  Undefine PHPSandbox interfaces by array
undefineMagicConst() : PHPSandbox
  Undefine PHPSandbox magic constant
undefineMagicConsts() : PHPSandbox
  Undefine PHPSandbox magic constants by array
undefineNamespace() : PHPSandbox
  Undefine PHPSandbox namespace
undefineNamespaces() : PHPSandbox
  Undefine PHPSandbox namespaces by array
undefineSuperglobal() : PHPSandbox
  Undefine PHPSandbox superglobal or superglobal key
undefineSuperglobals() : PHPSandbox
  Undefine PHPSandbox superglobals by array
undefineTrait() : PHPSandbox
  Undefine PHPSandbox trait
undefineTraits() : PHPSandbox
  Undefine PHPSandbox traits by array
undefineUse() : PHPSandbox
  Undefine PHPSandbox use (or alias)
undefineUses() : PHPSandbox
  Undefine PHPSandbox uses (or aliases) by array
undefineVar() : PHPSandbox
  Undefine PHPSandbox variable
undefineVars() : PHPSandbox
  Undefine PHPSandbox variables by array
unset_error_handler() :
unset_exception_handler() :
unset_validation_error_handler() :
unsetAliasValidator() : PHPSandbox
  Unset validation callable for aliases
unsetClassValidator() : PHPSandbox
  Unset validation callable for classes
unsetConstValidator() : PHPSandbox
  Unset validation callable for constants
unsetErrorHandler() : self
  Unset error handler
unsetExceptionHandler() : PHPSandbox
  Unset exception handler
unsetFuncValidator() : PHPSandbox
  Unset validation callable for functions
unsetGlobalValidator() : PHPSandbox
  Unset validation callable for globals
unsetInterfaceValidator() : PHPSandbox
  Unset validation callable for interfaces
unsetKeywordValidator() : PHPSandbox
  Unset validation callable for keywords
unsetMagicConstValidator() : PHPSandbox
  Unset validation callable for magic constants
unsetNamespaceValidator() : PHPSandbox
  Unset validation callable for namespaces
unsetOperatorValidator() : PHPSandbox
  Unset validation callable for operators
unsetPrimitiveValidator() : PHPSandbox
  Unset validation callable for primitives
unsetSuperglobalValidator() : PHPSandbox
  Unset validation callable for superglobals
unsetTraitValidator() : PHPSandbox
  Unset validation callable for traits
unsetTypeValidator() : PHPSandbox
  Unset validation callable for types
unsetUseValidator() : PHPSandbox
  Unset validation callable for uses (aka aliases)
unsetValidationErrorHandler() : PHPSandbox
  Unset validation error handler
unsetValidator() : PHPSandbox
  Unset validation callable for specified $type
unsetVarValidator() : PHPSandbox
  Unset validation callable for variables
validate() : PHPSandbox
  Validate passed callable for execution
validation_error() :
validationError() : mixed
  Invoke sandbox error validation handler if it exists, throw Error otherwise
whitelist() : PHPSandbox
  Whitelist PHPSandbox definitions, such as functions, constants, classes, etc. to set
whitelist_alias() :
whitelist_class() :
whitelist_const() :
whitelist_func() :
whitelist_global() :
whitelist_interface() :
whitelist_keyword() :
whitelist_magic_const() :
whitelist_namespace() :
whitelist_operator() :
whitelist_primitive() :
whitelist_superglobal() :
whitelist_trait() :
whitelist_type() :
whitelist_use() :
whitelist_var() :
whitelistAlias() : PHPSandbox
  Whitelist alias
whitelistClass() : PHPSandbox
  Whitelist class
whitelistConst() : PHPSandbox
  Whitelist constant
whitelistFunc() : PHPSandbox
  Whitelist function
whitelistGlobal() : PHPSandbox
  Whitelist global
whitelistInterface() : PHPSandbox
  Whitelist interface
whitelistKeyword() : PHPSandbox
  Whitelist keyword
whitelistMagicConst() : PHPSandbox
  Whitelist magic constant
whitelistNamespace() : PHPSandbox
  Whitelist namespace
whitelistOperator() : PHPSandbox
  Whitelist operator
whitelistPrimitive() : PHPSandbox
  Whitelist primitive
whitelistSuperglobal() : PHPSandbox
  Whitelist superglobal or superglobal key
whitelistTrait() : PHPSandbox
  Whitelist trait
whitelistType() : PHPSandbox
  Whitelist type
whitelistUse() : PHPSandbox
  Whitelist use (or alias)
whitelistVar() : PHPSandbox
  Whitelist variable
autoDefine() : PHPSandbox
  Automatically define variables passed to disassembled closure
autoWhitelist() : mixed
  Automatically whitelisted trusted code
disassemble() : string
  Disassemble callable to string
normalizeAlias() : string|array<string|int, mixed>
  Normalize alias name. This is an internal PHPSandbox function.
normalizeClass() : string|array<string|int, mixed>
  Normalize class name. This is an internal PHPSandbox function.
normalizeFunc() : string|array<string|int, mixed>
  Normalize function name. This is an internal PHPSandbox function.
normalizeInterface() : string|array<string|int, mixed>
  Normalize interface name. This is an internal PHPSandbox function.
normalizeKeyword() : string|array<string|int, mixed>
  Normalize keyword name. This is an internal PHPSandbox function.
normalizeMagicConst() : string|array<string|int, mixed>
  Normalize magic constant name. This is an internal PHPSandbox function.
normalizeNamespace() : string|array<string|int, mixed>
  Normalize namespace name. This is an internal PHPSandbox function.
normalizeOperator() : string|array<string|int, mixed>
  Normalize operator name. This is an internal PHPSandbox function.
normalizePrimitive() : string|array<string|int, mixed>
  Normalize primitive name. This is an internal PHPSandbox function.
normalizeSuperglobal() : string|array<string|int, mixed>
  Normalize superglobal name. This is an internal PHPSandbox function.
normalizeTrait() : string|array<string|int, mixed>
  Normalize trait name. This is an internal PHPSandbox function.
normalizeType() : string|array<string|int, mixed>
  Normalize type name. This is an internal PHPSandbox function.
normalizeUse() : string|array<string|int, mixed>
  Normalize use (or alias) name. This is an internal PHPSandbox function.
prepareAliases() : string
  Prepare defined aliases for execution
prepareConsts() : string
  Prepare defined constants for execution
prepareNamespaces() : string
  Prepare defined namespaces for execution
prepareUses() : string
  Prepare defined uses (or aliases) for execution
prepareVars() : string
  Prepare defined variables for execution

### Constants

#### IMPORT_ALL

PHPSandbox.php : 298
`public mixed IMPORT_ALL = 0`

##### Tags

const

  int A bit flag for the import() method, signifies to import all data from a template

#### IMPORT_BLACKLIST

PHPSandbox.php : 314
`public mixed IMPORT_BLACKLIST = 8`

##### Tags

const

  int A bit flag for the import() method, signifies to import only blacklists from a template

#### IMPORT_CODE

PHPSandbox.php : 322
`public mixed IMPORT_CODE = 32`

##### Tags

const

  int A bit flag for the import() method, signifies to import only sandboxed code from a template

#### IMPORT_DEFINITIONS

PHPSandbox.php : 306
`public mixed IMPORT_DEFINITIONS = 2`

##### Tags

const

  int A bit flag for the import() method, signifies to import only definitions from a template

#### IMPORT_OPTIONS

PHPSandbox.php : 302
`public mixed IMPORT_OPTIONS = 1`

##### Tags

const

  int A bit flag for the import() method, signifies to import only options from a template

#### IMPORT_TRUSTED_CODE

PHPSandbox.php : 318
`public mixed IMPORT_TRUSTED_CODE = 16`

##### Tags

const

  int A bit flag for the import() method, signifies to import only trusted code from a template

#### IMPORT_WHITELIST

PHPSandbox.php : 310
`public mixed IMPORT_WHITELIST = 4`

##### Tags

const

  int A bit flag for the import() method, signifies to import only whitelists from a template

#### SANDBOX_PREFIX

PHPSandbox.php : 294
`public mixed SANDBOX_PREFIX = '__PHPSandbox_'`

##### Tags

const

  string The prefix given to the obfuscated sandbox key passed to the generated code

### Properties

#### $allow_aliases

PHPSandbox.php : 699
`public bool $allow_aliases = false`

Should PHPSandbox allow sandboxed code to use namespaces and declare namespace aliases (utilizing the defineAlias function?)

##### Tags

default

  false

#### $allow_backticks

PHPSandbox.php : 744
`public bool $allow_backticks = false`

Should PHPSandbox allow sandboxed code to use backtick execution? (e.g. $var = `ping google.com`; This will also be disabled if shell_exec is not whitelisted or if it is blacklisted, and will be converted to a defined shell_exec function call if one is defined)

##### Tags

default

  false

#### $allow_casting

PHPSandbox.php : 729
`public bool $allow_casting = false`

Should PHPSandbox allow sandboxed code to cast types? (This will still be subject to allowed classes)

##### Tags

default

  false

#### $allow_classes

PHPSandbox.php : 704
`public bool $allow_classes = false`

Should PHPSandbox allow sandboxed code to declare classes?

##### Tags

default

  false

#### $allow_closures

PHPSandbox.php : 664
`public bool $allow_closures = false`

Should PHPSandbox allow sandboxed code to declare closures?

##### Tags

default

  false

#### $allow_constants

PHPSandbox.php : 684
`public bool $allow_constants = false`

Should PHPSandbox allow sandboxed code to define constants?

##### Tags

default

  false

#### $allow_error_suppressing

PHPSandbox.php : 734
`public bool $allow_error_suppressing = false`

Should PHPSandbox allow sandboxed code to suppress errors (e.g. the @ operator?)

##### Tags

default

  false

#### $allow_escaping

PHPSandbox.php : 724
`public bool $allow_escaping = false`

Should PHPSandbox allow sandboxed code to escape to HTML?

##### Tags

default

  false

#### $allow_functions

PHPSandbox.php : 659
`public bool $allow_functions = false`

Should PHPSandbox allow sandboxed code to declare functions?

##### Tags

default

  false

#### $allow_generators

PHPSandbox.php : 719
`public bool $allow_generators = true`

Should PHPSandbox allow sandboxed code to create generators?

##### Tags

default

  true

#### $allow_globals

PHPSandbox.php : 689
`public bool $allow_globals = false`

Should PHPSandbox allow sandboxed code to use global keyword to access variables in the global scope?

##### Tags

default

  false

#### $allow_halting

PHPSandbox.php : 749
`public bool $allow_halting = false`

Should PHPSandbox allow sandboxed code to halt the PHP compiler?

##### Tags

default

  false

#### $allow_includes

PHPSandbox.php : 574
`public bool $allow_includes = false`

Flag to indicate whether the sandbox should allow included files

##### Tags

default

  false

#### $allow_interfaces

PHPSandbox.php : 709
`public bool $allow_interfaces = false`

Should PHPSandbox allow sandboxed code to declare interfaces?

##### Tags

default

  false

#### $allow_namespaces

PHPSandbox.php : 694
`public bool $allow_namespaces = false`

Should PHPSandbox allow sandboxed code to declare namespaces (utilizing the defineNamespace function?)

##### Tags

default

  false

#### $allow_objects

PHPSandbox.php : 679
`public bool $allow_objects = true`

Should PHPSandbox allow sandboxed code to create objects of allow classes (e.g. new keyword)?

##### Tags

default

  true

#### $allow_references

PHPSandbox.php : 739
`public bool $allow_references = true`

Should PHPSandbox allow sandboxed code to assign references?

##### Tags

default

  true

#### $allow_static_variables

PHPSandbox.php : 674
`public bool $allow_static_variables = true`

Should PHPSandbox allow sandboxed code to create static variables?

##### Tags

default

  true

#### $allow_traits

PHPSandbox.php : 714
`public bool $allow_traits = false`

Should PHPSandbox allow sandboxed code to declare traits?

##### Tags

default

  false

#### $allow_variables

PHPSandbox.php : 669
`public bool $allow_variables = true`

Should PHPSandbox allow sandboxed code to create variables?

##### Tags

default

  true

#### $arg_funcs

PHPSandbox.php : 369
`public static array<string|int, mixed> $arg_funcs = ['func_get_args', 'func_get_arg', 'func_num_args']`

A static array of func_get_args, func_get_arg, and func_num_args used for redefining those functions

##### Tags

static

#### $auto_define_vars

PHPSandbox.php : 634
`public bool $auto_define_vars = true`

Should PHPSandbox automagically define variables passed to prepended, appended and prepared code closures?

##### Tags

default

  true

#### $auto_whitelist_classes

PHPSandbox.php : 619
`public bool $auto_whitelist_classes = true`

Should PHPSandbox automagically whitelist classes created in sandboxed code if $allow_classes is true?

##### Tags

default

  true

#### $auto_whitelist_constants

PHPSandbox.php : 609
`public bool $auto_whitelist_constants = true`

Should PHPSandbox automagically whitelist constants created in sandboxed code if $allow_constants is true?

##### Tags

default

  true

#### $auto_whitelist_functions

PHPSandbox.php : 604
`public bool $auto_whitelist_functions = true`

Should PHPSandbox automagically whitelist functions created in sandboxed code if $allow_functions is true?

##### Tags

default

  true

#### $auto_whitelist_globals

PHPSandbox.php : 614
`public bool $auto_whitelist_globals = true`

Should PHPSandbox automagically whitelist global variables created in sandboxed code if $allow_globals is true? (Used to whitelist them in the variables list)

##### Tags

default

  true

#### $auto_whitelist_interfaces

PHPSandbox.php : 624
`public bool $auto_whitelist_interfaces = true`

Should PHPSandbox automagically whitelist interfaces created in sandboxed code if $allow_interfaces is true?

##### Tags

default

  true

#### $auto_whitelist_traits

PHPSandbox.php : 629
`public bool $auto_whitelist_traits = true`

Should PHPSandbox automagically whitelist traits created in sandboxed code if $allow_traits is true?

##### Tags

default

  true

#### $auto_whitelist_trusted_code

PHPSandbox.php : 599
`public bool $auto_whitelist_trusted_code = true`

Should PHPSandbox automagically whitelist prepended and appended code?

##### Tags

default

  true

#### $capture_output

PHPSandbox.php : 594
`public bool $capture_output = false`

Flag whether to return output via an output buffer

##### Tags

default

  false

#### $convert_errors

PHPSandbox.php : 589
`public bool $convert_errors = false`

Flag to indicate whether the sandbox should convert errors to exceptions

##### Tags

default

  false

#### $defined_funcs

PHPSandbox.php : 356
`public static array<string|int, mixed> $defined_funcs = ['get_defined_functions', 'get_defined_vars', 'get_defined_constants', 'get_declared_classes', 'get_declared_interfaces', 'get_declared_traits', 'get_included_files']`

A static array of defined_* and declared_* functions names used for redefining defined_* and declared_* values

##### Tags

static

#### $error_level

PHPSandbox.php : 564
`public int|null $error_level = null`

The error_reporting level to set the PHPSandbox scope to when executing the generated closure, if set to null it will use parent scope error level.

##### Tags

default

  true

#### $magic_constants

PHPSandbox.php : 342
`public static array<string|int, mixed> $magic_constants = ['__LINE__', '__FILE__', '__DIR__', '__FUNCTION__', '__CLASS__', '__TRAIT__', '__METHOD__', '__NAMESPACE__']`

A static array of magic constant names used for redefining magic constant values

##### Tags

static

#### $name

PHPSandbox.php : 395
`public string $name = ''`

The randomly generated name of the PHPSandbox variable passed to the generated closure

#### $overwrite_defined_funcs

PHPSandbox.php : 639
`public bool $overwrite_defined_funcs = true`

Should PHPSandbox overwrite get_defined_functions, get_defined_vars, get_defined_constants, get_declared_classes, get_declared_interfaces and get_declared_traits?

##### Tags

default

  true

#### $overwrite_func_get_args

PHPSandbox.php : 644
`public bool $overwrite_func_get_args = true`

Should PHPSandbox overwrite func_get_args, func_get_arg and func_num_args?

##### Tags

default

  true

#### $overwrite_sandboxed_string_funcs

PHPSandbox.php : 649
`public bool $overwrite_sandboxed_string_funcs = true`

Should PHPSandbox overwrite functions to help hide SandboxedStrings?

##### Tags

default

  true

#### $overwrite_superglobals

PHPSandbox.php : 654
`public bool $overwrite_superglobals = true`

Should PHPSandbox overwrite $_GET, $_POST, $_COOKIE, $_FILES, $_ENV, $_REQUEST, $_SERVER, $_SESSION and $GLOBALS superglobals? If so, unless alternate superglobal values have been defined they will return as empty arrays.

##### Tags

default

  true

#### $restore_error_level

PHPSandbox.php : 584
`public bool $restore_error_level = true`

Flag to indicate whether the sandbox should return error_reporting to its previous level after execution

##### Tags

default

  true

#### $sandbox_includes

PHPSandbox.php : 579
`public bool $sandbox_includes = true`

Flag to indicate whether the sandbox should automatically sandbox included files

##### Tags

default

  true

#### $sandbox_strings

PHPSandbox.php : 754
`public bool $sandbox_strings = true`

Should PHPSandbox sandbox all string values?

##### Tags

default

  true

#### $sandboxed_string_funcs

PHPSandbox.php : 379
`public static array<string|int, mixed> $sandboxed_string_funcs = ['var_dump', 'print_r', 'var_export', 'intval', 'floatval', 'boolval', 'is_string', 'is_object', 'is_scalar', 'is_callable', 'array_key_exists']`

A static array of var_dump, print_r and var_export, intval, floatval, is_string, is_object, is_scalar, is_callable, and array_key_exists for redefining those functions

##### Tags

static

#### $superglobals

PHPSandbox.php : 327
`public static array<string|int, mixed> $superglobals = ['_GET', '_POST', '_COOKIE', '_FILES', '_ENV', '_REQUEST', '_SERVER', '_SESSION', 'GLOBALS']`

A static array of superglobal names used for redefining superglobal values

##### Tags

static

#### $time_limit

PHPSandbox.php : 569
`public int $time_limit = 0`

Integer value of maximum number of seconds the sandbox should be allowed to execute

##### Tags

default

  0

#### $validate_aliases

PHPSandbox.php : 524
`public bool $validate_aliases = true`

Flag to indicate whether the sandbox should validate aliases (aka use)

##### Tags

default

  true

#### $validate_classes

PHPSandbox.php : 529
`public bool $validate_classes = true`

Flag to indicate whether the sandbox should validate classes

##### Tags

default

  true

#### $validate_constants

PHPSandbox.php : 509
`public bool $validate_constants = true`

Flag to indicate whether the sandbox should validate constants

##### Tags

default

  true

#### $validate_functions

PHPSandbox.php : 489
`public bool $validate_functions = true`

Flag to indicate whether the sandbox should validate functions

##### Tags

default

  true

#### $validate_globals

PHPSandbox.php : 499
`public bool $validate_globals = true`

Flag to indicate whether the sandbox should validate globals

##### Tags

default

  true

#### $validate_interfaces

PHPSandbox.php : 534
`public bool $validate_interfaces = true`

Flag to indicate whether the sandbox should validate interfaces

##### Tags

default

  true

#### $validate_keywords

PHPSandbox.php : 544
`public bool $validate_keywords = true`

Flag to indicate whether the sandbox should validate keywords

##### Tags

default

  true

#### $validate_magic_constants

PHPSandbox.php : 514
`public bool $validate_magic_constants = true`

Flag to indicate whether the sandbox should validate magic constants

##### Tags

default

  true

#### $validate_namespaces

PHPSandbox.php : 519
`public bool $validate_namespaces = true`

Flag to indicate whether the sandbox should validate namespaces

##### Tags

default

  true

#### $validate_operators

PHPSandbox.php : 549
`public bool $validate_operators = true`

Flag to indicate whether the sandbox should validate operators

##### Tags

default

  true

#### $validate_primitives

PHPSandbox.php : 554
`public bool $validate_primitives = true`

Flag to indicate whether the sandbox should validate primitives

##### Tags

default

  true

#### $validate_superglobals

PHPSandbox.php : 504
`public bool $validate_superglobals = true`

Flag to indicate whether the sandbox should validate superglobals

##### Tags

default

  true

#### $validate_traits

PHPSandbox.php : 539
`public bool $validate_traits = true`

Flag to indicate whether the sandbox should validate traits

##### Tags

default

  true

#### $validate_types

PHPSandbox.php : 559
`public bool $validate_types = true`

Flag to indicate whether the sandbox should validate types

##### Tags

default

  true

#### $validate_variables

PHPSandbox.php : 494
`public bool $validate_variables = true`

Flag to indicate whether the sandbox should validate variables

##### Tags

default

  true

#### $appended_code

PHPSandbox.php : 763
`protected string $appended_code = ''`

String of appended code, will be automagically whitelisted for functions, variables, globals, constants, classes, interfaces and traits if $auto_whitelist_trusted_code is true

#### $blacklist

PHPSandbox.php : 434
`protected array<string|int, mixed> $blacklist = ['functions' => [], 'variables' => [], 'globals' => [], 'superglobals' => [], 'constants' => [], 'magic_constants' => [], 'namespaces' => [], 'aliases' => [], 'classes' => [], 'interfaces' => [], 'traits' => [], 'keywords' => ['declare' => true, 'eval' => true, 'exit' => true, 'halt' => true], 'operators' => [], 'primitives' => [], 'types' => []]`

Array of blacklisted functions, classes, etc. Any whitelisted array types override their counterpart in this array

#### $definitions

PHPSandbox.php : 399
`protected array<string|int, mixed> $definitions = ['functions' => [], 'variables' => [], 'superglobals' => [], 'constants' => [], 'magic_constants' => [], 'namespaces' => [], 'aliases' => [], 'classes' => [], 'interfaces' => [], 'traits' => []]`

Array of defined functions, superglobals, etc. If an array type contains elements, then it overwrites its external counterpart

#### $error_handler

PHPSandbox.php : 800
`protected callable|null $error_handler`

Callable that handles any errors when set

#### $error_handler_types

PHPSandbox.php : 804
`protected int $error_handler_types = E_ALL`

Integer value of the error types to handle (default is E_ALL)

#### $exception_handler

PHPSandbox.php : 812
`protected callable|null $exception_handler`

Callable that handles any thrown exceptions when set

#### $executing_file

PHPSandbox.php : 828
`protected string|null $executing_file = null`

The current file being executed

#### $execution_time

PHPSandbox.php : 772
`protected float $execution_time = 0.0`

Float of the number of microseconds it took to execute the sandbox

#### $generated_code

PHPSandbox.php : 796
`protected string $generated_code = ''`

String of generated code, for debugging and serialization purposes

#### $includes

PHPSandbox.php : 479
`protected array<string|int, mixed> $includes = []`

Array of sandboxed included files

#### $last_error

PHPSandbox.php : 808
`protected array<string|int, mixed>|null $last_error`

The last error thrown by the sandbox

#### $last_exception

PHPSandbox.php : 816
`protected Throwable|null $last_exception = null`

The last exception thrown by the sandbox

#### $last_validation_error

PHPSandbox.php : 824
`protected Throwable|null $last_validation_error = null`

The last validation error thrown by the sandbox

#### $memory_usage

PHPSandbox.php : 776
`protected int $memory_usage = 0`

Int of the number of bytes the sandbox allocates during execution

#### $parsed_ast

PHPSandbox.php : 784
`protected array<string|int, mixed> $parsed_ast = []`

Array of parsed code broken down into AST tokens, for debugging and serialization purposes

#### $prepare_time

PHPSandbox.php : 768
`protected float $prepare_time = 0.0`

Float of the number of microseconds it took to prepare the sandbox

#### $prepared_ast

PHPSandbox.php : 792
`protected array<string|int, mixed> $prepared_ast = []`

Array of prepared code broken down into AST tokens, for debugging and serialization purposes

#### $prepared_code

PHPSandbox.php : 788
`protected string $prepared_code = ''`

String of prepared code, for debugging and serialization purposes

#### $preparsed_code

PHPSandbox.php : 780
`protected string $preparsed_code = ''`

String of preparsed code, for debugging and serialization purposes

#### $prepended_code

PHPSandbox.php : 759
`protected string $prepended_code = ''`

String of prepended code, will be automagically whitelisted for functions, variables, globals, constants, classes, interfaces and traits if $auto_whitelist_trusted_code is true

#### $sandboxes

PHPSandbox.php : 483
`protected static array<string|int, mixed> $sandboxes = []`

Array of PHPSandboxes

#### $validation

PHPSandbox.php : 459
`protected array<string|int, mixed> $validation = ['function' => null, 'variable' => null, 'global' => null, 'superglobal' => null, 'constant' => null, 'magic_constant' => null, 'namespace' => null, 'alias' => null, 'class' => null, 'interface' => null, 'trait' => null, 'keyword' => null, 'operator' => null, 'primitive' => null, 'type' => null]`

Array of custom validation functions

#### $validation_error_handler

PHPSandbox.php : 820
`protected callable|null $validation_error_handler`

Callable that handles any thrown validation errors when set

#### $whitelist

PHPSandbox.php : 414
`protected array<string|int, mixed> $whitelist = ['functions' => [], 'variables' => [], 'globals' => [], 'superglobals' => [], 'constants' => [], 'magic_constants' => [], 'namespaces' => [], 'aliases' => [], 'classes' => [], 'interfaces' => [], 'traits' => [], 'keywords' => [], 'operators' => [], 'primitives' => [], 'types' => []]`

Array of whitelisted functions, classes, etc. If an array type contains elements, then it overrides its blacklist counterpart

### Methods

#### __call()

PHPSandbox.php : 7228

Magic method to provide API compatibility for v1.* code

`public __call(string $method, array<string|int, mixed> $arguments) : mixed`

##### Parameters

$method : string

  The method name to call

$arguments : array<string|int, mixed>

  The method arguments to call

##### Return values

mixed —

#### __construct()

PHPSandbox.php : 848

PHPSandbox class constructor

`public __construct([array<string|int, mixed> $options = [] ][, array<string|int, mixed> $functions = [] ][, array<string|int, mixed> $variables = [] ][, array<string|int, mixed> $constants = [] ][, array<string|int, mixed> $namespaces = [] ][, array<string|int, mixed> $aliases = [] ][, array<string|int, mixed> $superglobals = [] ][, array<string|int, mixed> $magic_constants = [] ][, array<string|int, mixed> $classes = [] ][, array<string|int, mixed> $interfaces = [] ][, array<string|int, mixed> $traits = [] ]) : mixed`

You can pass optional arrays of predefined functions, variables, etc. to the sandbox through the constructor

##### Parameters

$options : array<string|int, mixed> = []

  Optional array of options to set for the sandbox

$functions : array<string|int, mixed> = []

  Optional array of functions to define for the sandbox

$variables : array<string|int, mixed> = []

  Optional array of variables to define for the sandbox

$constants : array<string|int, mixed> = []

  Optional array of constants to define for the sandbox

$namespaces : array<string|int, mixed> = []

  Optional array of namespaces to define for the sandbox

$aliases : array<string|int, mixed> = []

  Optional array of aliases to define for the sandbox

$superglobals : array<string|int, mixed> = []

  Optional array of superglobals to define for the sandbox

$magic_constants : array<string|int, mixed> = []

  Optional array of magic constants to define for the sandbox

$classes : array<string|int, mixed> = []

  Optional array of classes to define for the sandbox

$interfaces : array<string|int, mixed> = []

  Optional array of interfaces to define for the sandbox

$traits : array<string|int, mixed> = []

  Optional array of traits to define for the sandbox

##### Tags

throws
  Throwable

  Throws exception if definition fails

##### Return values

mixed —

#### __invoke()

PHPSandbox.php : 913

PHPSandbox __invoke magic method

`public __invoke(Closure|callable|string $code) : mixed`

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

##### Parameters

$code : Closure|callable|string

  The closure, callable or string of code to execute

##### Return values

mixed —

The output of the executed sandboxed code

#### __sleep()

PHPSandbox.php : 921

PHPSandbox __sleep magic method

`public __sleep() : array<string|int, mixed>`

##### Return values

array<string|int, mixed> —

An array of property keys to be serialized

#### _array_key_exists()

PHPSandbox.php : 2308

Get PHPSandbox redefined array_key_exists

`public _array_key_exists(string|SandboxedString $key, array<string|int, mixed> $array) : bool`

##### Parameters

$key : string|SandboxedString

  The key to check for

$array : array<string|int, mixed>

  The array to check against

##### Return values

bool —

Returns the value from array_key_exists()

#### _arrayval()

PHPSandbox.php : 2354

Return array value of SandboxedString or mixed value

`public _arrayval(mixed $value) : array<string|int, mixed>`

##### Parameters

$value : mixed

  Value to return as array

##### Return values

array<string|int, mixed> —

Returns the array value

#### _boolval()

PHPSandbox.php : 2341

Return boolean value of SandboxedString or mixed value

`public _boolval(mixed $value) : bool`

##### Parameters

$value : mixed

  Value to return as boolean

##### Return values

bool —

Returns the boolean value

#### _floatval()

PHPSandbox.php : 2331

Return float value of SandboxedString or mixed value

`public _floatval(mixed $value) : float`

##### Parameters

$value : mixed

  Value to return as float

##### Return values

float —

Returns the float value

#### _func_get_arg()

PHPSandbox.php : 2230

Get PHPSandbox redefined function argument

`public _func_get_arg([array<string|int, mixed> $arguments = [] ], int $index) : mixed`

##### Parameters

$arguments : array<string|int, mixed> = []

  Array result from func_get_args() is passed here

$index : int

  Requested func_get_arg index is passed here

##### Return values

mixed —

Returns the redefined argument

#### _func_get_args()

PHPSandbox.php : 2213

Get PHPSandbox redefined function arguments array

`public _func_get_args([array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>`

##### Parameters

$arguments : array<string|int, mixed> = []

  Array result from func_get_args() is passed here

##### Return values

array<string|int, mixed> —

Returns the redefined arguments array

#### _func_num_args()

PHPSandbox.php : 2243

Get PHPSandbox redefined number of function arguments

`public _func_num_args([array<string|int, mixed> $arguments = [] ]) : int`

##### Parameters

$arguments : array<string|int, mixed> = []

  Array result from func_get_args() is passed here

##### Return values

int —

Returns the redefined number of function arguments

#### _get_declared_classes()

PHPSandbox.php : 2075

Get PHPSandbox redefined classes in place of get_declared_classes(). This is an internal PHPSandbox function but requires public access to work.

`public _get_declared_classes([array<string|int, mixed> $classes = [] ]) : array<string|int, mixed>`

##### Parameters

$classes : array<string|int, mixed> = []

  Array result from get_declared_classes() is passed here

##### Return values

array<string|int, mixed> —

Returns the redefined classes

#### _get_declared_interfaces()

PHPSandbox.php : 2121

Get PHPSandbox redefined interfaces in place of get_declared_interfaces(). This is an internal PHPSandbox function but requires public access to work.

`public _get_declared_interfaces([array<string|int, mixed> $interfaces = [] ]) : array<string|int, mixed>`

##### Parameters

$interfaces : array<string|int, mixed> = []

  Array result from get_declared_interfaces() is passed here

##### Return values

array<string|int, mixed> —

Returns the redefined interfaces

#### _get_declared_traits()

PHPSandbox.php : 2167

Get PHPSandbox redefined traits in place of get_declared_traits(). This is an internal PHPSandbox function but requires public access to work.

`public _get_declared_traits([array<string|int, mixed> $traits = [] ]) : array<string|int, mixed>`

##### Parameters

$traits : array<string|int, mixed> = []

  Array result from get_declared_traits() is passed here

##### Return values

array<string|int, mixed> —

Returns the redefined traits

#### _get_defined_constants()

PHPSandbox.php : 2043

Get PHPSandbox redefined constants in place of get_defined_constants(). This is an internal PHPSandbox function but requires public access to work.

`public _get_defined_constants([array<string|int, mixed> $constants = [] ]) : array<string|int, mixed>`

##### Parameters

$constants : array<string|int, mixed> = []

  Array result from get_defined_constants() is passed here

##### Return values

array<string|int, mixed> —

Returns the redefined constants

#### _get_defined_functions()

PHPSandbox.php : 1933

Get PHPSandbox redefined functions in place of get_defined_functions(). This is an internal PHPSandbox function but requires public access to work.

`public _get_defined_functions([array<string|int, mixed> $functions = [] ]) : array<string|int, mixed>`

##### Parameters

$functions : array<string|int, mixed> = []

  Array result from get_defined_functions() is passed here

##### Return values

array<string|int, mixed> —

Returns the redefined functions array

#### _get_defined_vars()

PHPSandbox.php : 1967

Get PHPSandbox redefined variables in place of get_defined_vars(). This is an internal PHPSandbox function but requires public access to work.

`public _get_defined_vars([array<string|int, mixed> $variables = [] ]) : array<string|int, mixed>`

##### Parameters

$variables : array<string|int, mixed> = []

  Array result from get_defined_vars() is passed here

##### Return values

array<string|int, mixed> —

Returns the redefined variables array

#### _get_included_files()

PHPSandbox.php : 2421

Return get_included_files() and sandboxed included files

`public _get_included_files() : array<string|int, mixed>`

##### Return values

array<string|int, mixed> —

Returns array of get_included_files() and sandboxed included files

#### _get_magic_const()

PHPSandbox.php : 2025

Get PHPSandbox redefined magic constant. This is an internal PHPSandbox function but requires public access to work.

`public _get_magic_const(string $name) : mixed`

##### Parameters

$name : string

  Requested magic constant name (e.g. FILE, LINE, etc.)

##### Return values

mixed —

Returns the redefined magic constant

#### _get_superglobal()

PHPSandbox.php : 1980

Get PHPSandbox redefined superglobal. This is an internal PHPSandbox function but requires public access to work.

`public _get_superglobal(string $name) : array<string|int, mixed>`

##### Parameters

$name : string

  Requested superglobal name (e.g. _GET, _POST, etc.)

##### Return values

array<string|int, mixed> —

Returns the redefined superglobal

#### _include()

PHPSandbox.php : 2431

Sandbox included file

`public _include(string $file) : mixed`

##### Parameters

$file : string

  Included file to sandbox

##### Return values

mixed —

Returns value passed from included file

#### _include_once()

PHPSandbox.php : 2452

Sandbox included once file

`public _include_once(string $file) : mixed`

##### Parameters

$file : string

  Included once file to sandbox

##### Return values

mixed —

Returns value passed from included once file

#### _intval()

PHPSandbox.php : 2321

Return integer value of SandboxedString or mixed value

`public _intval(mixed $value) : int`

##### Parameters

$value : mixed

  Value to return as integer

##### Return values

int —

Returns the integer value

#### _is_callable()

PHPSandbox.php : 2410

Return is_callable value of SandboxedString or mixed value

`public _is_callable(mixed $value) : bool`

##### Parameters

$value : mixed

  Value to check if is_callable

##### Return values

bool —

Returns the is_callable value

#### _is_object()

PHPSandbox.php : 2390

Return is_object value of SandboxedString or mixed value

`public _is_object(mixed $value) : bool`

##### Parameters

$value : mixed

  Value to check if is_object

##### Return values

bool —

Returns the is_object value

#### _is_scalar()

PHPSandbox.php : 2400

Return is_scalar value of SandboxedString or mixed value

`public _is_scalar(mixed $value) : bool`

##### Parameters

$value : mixed

  Value to check if is_scalar

##### Return values

bool —

Returns the is_scalar value

#### _is_string()

PHPSandbox.php : 2380

Return is_string value of SandboxedString or mixed value

`public _is_string(mixed $value) : bool`

##### Parameters

$value : mixed

  Value to check if is_string

##### Return values

bool —

Returns the is_string value

#### _objectval()

PHPSandbox.php : 2367

Return object value of SandboxedString or mixed value

`public _objectval(mixed $value) : object`

##### Parameters

$value : mixed

  Value to return as object

##### Return values

object —

Returns the object value

#### _print_r()

PHPSandbox.php : 2273

Get PHPSandbox redefined print_r

`public _print_r() : bool|string`

##### Return values

bool|string —

Returns the value from print_r()

#### _require()

PHPSandbox.php : 2474

Sandbox required file

`public _require(string $file) : mixed`

##### Parameters

$file : string

  Required file to sandbox

##### Return values

mixed —

Returns value passed from required file

#### _require_once()

PHPSandbox.php : 2496

Sandbox required once file

`public _require_once(string $file) : mixed`

##### Parameters

$file : string

  Required once file to sandbox

##### Return values

mixed —

Returns value passed from required once file

#### _var_dump()

PHPSandbox.php : 2257

Get PHPSandbox redefined var_dump

`public _var_dump() : void`

##### Return values

void —

var_dump() does not return any value

#### _var_export()

PHPSandbox.php : 2289

Get PHPSandbox redefined var_export

`public _var_export() : string|null`

##### Return values

string|null —

Returns the value from var_export()

#### append()

PHPSandbox.php : 6715

Append trusted code

`public append(string|callable $code) : PHPSandbox`

##### Parameters

$code : string|callable

  String or callable of trusted $code to append to generated code

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### auto_define()

PHPSandbox.php : 0
`public auto_define() :`

##### Return values

—

#### auto_whitelist()

PHPSandbox.php : 0
`public auto_whitelist() :`

##### Return values

—

#### blacklist()

PHPSandbox.php : 4067

Blacklist PHPSandbox definitions, such as functions, constants, classes, etc. to set

`public blacklist(string|array<string|int, mixed> $type[, string|array<string|int, mixed>|null $name = null ]) : PHPSandbox`

You can pass an associative array of blacklist types and their names, or a string $type and array of $names, or pass a string of the $type and $name

##### Parameters

$type : string|array<string|int, mixed>

  Associative array or string of blacklist type to set

$name : string|array<string|int, mixed>|null = null

  Array or string of blacklist name to set

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### blacklist_alias()

PHPSandbox.php : 0
`public blacklist_alias() :`

##### Return values

—

#### blacklist_class()

PHPSandbox.php : 0
`public blacklist_class() :`

##### Return values

—

#### blacklist_const()

PHPSandbox.php : 0
`public blacklist_const() :`

##### Return values

—

#### blacklist_func()

PHPSandbox.php : 0
`public blacklist_func() :`

##### Return values

—

#### blacklist_global()

PHPSandbox.php : 0
`public blacklist_global() :`

##### Return values

—

#### blacklist_interface()

PHPSandbox.php : 0
`public blacklist_interface() :`

##### Return values

—

#### blacklist_keyword()

PHPSandbox.php : 0
`public blacklist_keyword() :`

##### Return values

—

#### blacklist_magic_const()

PHPSandbox.php : 0
`public blacklist_magic_const() :`

##### Return values

—

#### blacklist_namespace()

PHPSandbox.php : 0
`public blacklist_namespace() :`

##### Return values

—

#### blacklist_operator()

PHPSandbox.php : 0
`public blacklist_operator() :`

##### Return values

—

#### blacklist_primitive()

PHPSandbox.php : 0
`public blacklist_primitive() :`

##### Return values

—

#### blacklist_superglobal()

PHPSandbox.php : 0
`public blacklist_superglobal() :`

##### Return values

—

#### blacklist_trait()

PHPSandbox.php : 0
`public blacklist_trait() :`

##### Return values

—

#### blacklist_type()

PHPSandbox.php : 0
`public blacklist_type() :`

##### Return values

—

#### blacklist_use()

PHPSandbox.php : 0
`public blacklist_use() :`

##### Return values

—

#### blacklist_var()

PHPSandbox.php : 0
`public blacklist_var() :`

##### Return values

—

#### blacklistAlias()

PHPSandbox.php : 5392

Blacklist alias

`public blacklistAlias(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of alias name, or pass an array of the alias names to blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of alias name or array of alias names to blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### blacklistClass()

PHPSandbox.php : 5524

Blacklist class

`public blacklistClass(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of class name, or pass an array of the class names to blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of class name or array of class names to blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### blacklistConst()

PHPSandbox.php : 5203

Blacklist constant

`public blacklistConst(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of constant name, or pass an array of the constant names to blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of constant name or array of constant names to blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### blacklistFunc()

PHPSandbox.php : 4830

Blacklist function

`public blacklistFunc(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of the function name, or pass an array of function names to blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of function name, or array of function names to blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### blacklistGlobal()

PHPSandbox.php : 4953

Blacklist global

`public blacklistGlobal(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of global name, or pass an array of the global names to blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of global name or array of global names to blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### blacklistInterface()

PHPSandbox.php : 5588

Blacklist interface

`public blacklistInterface(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of interface name, or pass an array of the interface names to blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of interface name or array of interface names to blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### blacklistKeyword()

PHPSandbox.php : 5716

Blacklist keyword

`public blacklistKeyword(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of keyword name, or pass an array of the keyword names to blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of keyword name or array of keyword names to blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### blacklistMagicConst()

PHPSandbox.php : 5264

Blacklist magic constant

`public blacklistMagicConst(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of magic constant name, or pass an array of the magic constant names to blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of magic constant name or array of magic constant names to blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### blacklistNamespace()

PHPSandbox.php : 5328

Blacklist namespace

`public blacklistNamespace(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of namespace name, or pass an array of the namespace names to blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of namespace name or array of namespace names to blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### blacklistOperator()

PHPSandbox.php : 5780

Blacklist operator

`public blacklistOperator(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of operator name, or pass an array of the operator names to blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of operator name or array of operator names to blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### blacklistPrimitive()

PHPSandbox.php : 5844

Blacklist primitive

`public blacklistPrimitive(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of primitive name, or pass an array of the primitive names to blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of primitive name or array of primitive names to blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### blacklistSuperglobal()

PHPSandbox.php : 5051

Blacklist superglobal or superglobal key * You can pass a string of the superglobal name, or a string of the superglobal name and a string of the key, or pass an array of superglobal names, or an associative array of superglobal names and their keys to blacklist

`public blacklistSuperglobal(string|array<string|int, mixed> $name[, string|null $key = null ]) : PHPSandbox`

##### Parameters

$name : string|array<string|int, mixed>

  String of superglobal name, or an array of superglobal names, or an associative array of superglobal names and their keys to blacklist

$key : string|null = null

  String of superglobal key to blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### blacklistTrait()

PHPSandbox.php : 5652

Blacklist trait

`public blacklistTrait(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of trait name, or pass an array of the trait names to blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of trait name or array of trait names to blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### blacklistType()

PHPSandbox.php : 5908

Blacklist type

`public blacklistType(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of type name, or pass an array of the type names to blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of type name or array of type names to blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### blacklistUse()

PHPSandbox.php : 5459

Blacklist use (or alias)

`public blacklistUse(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of use (or alias) name, or pass an array of the use (or alias) names to blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of use (or alias) name or array of use (or alias) names to blacklist

##### Tags

alias

  blacklistAlias();

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### blacklistVar()

PHPSandbox.php : 4893

Blacklist variable

`public blacklistVar(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of variable name, or pass an array of the variable names to blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of variable name or array of variable names to blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### call_func()

PHPSandbox.php : 2519

Get PHPSandbox redefined function. This is an internal PHPSandbox function but requires public access to work.

`public call_func() : mixed`

##### Tags

throws
  Throwable

  Will throw exception if invalid function requested

##### Return values

mixed —

Returns the redefined function result

#### check_alias()

PHPSandbox.php : 0
`public check_alias() :`

##### Return values

—

#### check_class()

PHPSandbox.php : 0
`public check_class() :`

##### Return values

—

#### check_const()

PHPSandbox.php : 0
`public check_const() :`

##### Return values

—

#### check_func()

PHPSandbox.php : 0
`public check_func(string $name) :`

##### Parameters

$name : string

##### Return values

—

#### check_global()

PHPSandbox.php : 0
`public check_global() :`

##### Return values

—

#### check_interface()

PHPSandbox.php : 0
`public check_interface() :`

##### Return values

—

#### check_keyword()

PHPSandbox.php : 0
`public check_keyword() :`

##### Return values

—

#### check_magic_const()

PHPSandbox.php : 0
`public check_magic_const() :`

##### Return values

—

#### check_namespace()

PHPSandbox.php : 0
`public check_namespace() :`

##### Return values

—

#### check_operator()

PHPSandbox.php : 0
`public check_operator() :`

##### Return values

—

#### check_primitive()

PHPSandbox.php : 0
`public check_primitive() :`

##### Return values

—

#### check_superglobal()

PHPSandbox.php : 0
`public check_superglobal() :`

##### Return values

—

#### check_trait()

PHPSandbox.php : 0
`public check_trait() :`

##### Return values

—

#### check_type()

PHPSandbox.php : 0
`public check_type() :`

##### Return values

—

#### check_use()

PHPSandbox.php : 0
`public check_use() :`

##### Return values

—

#### check_var()

PHPSandbox.php : 0
`public check_var() :`

##### Return values

—

#### checkAlias()

PHPSandbox.php : 6226

Check alias name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.

`public checkAlias(string $name) : bool`

##### Parameters

$name : string

  String of the alias name to check

##### Tags

throws
  Throwable

  Throws exception if validation error occurs

##### Return values

bool —

Returns true if alias is valid

#### checkClass()

PHPSandbox.php : 6277

Check class name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.

`public checkClass(string $name[, bool $extends = false ]) : bool`

##### Parameters

$name : string

  String of the class name to check

$extends : bool = false

  Flag whether this is an extended class

##### Tags

throws
  Throwable

  Throws exception if validation error occurs

##### Return values

bool —

Returns true if class is valid

#### checkConst()

PHPSandbox.php : 6107

Check constant name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.

`public checkConst(string $name) : bool`

##### Parameters

$name : string

  String of the constant name to check

##### Tags

throws
  Throwable

  Throws exception if validation error occurs

##### Return values

bool —

Returns true if constant is valid

#### checkFunc()

PHPSandbox.php : 5955

Check function name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.

`public checkFunc(string $name) : bool`

##### Parameters

$name : string

  String of the function name to check

##### Tags

throws
  Throwable

  Throws exception if validation error occurs

##### Return values

bool —

Returns true if function is valid, this is also used for testing closures

#### checkGlobal()

PHPSandbox.php : 6034

Check global name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.

`public checkGlobal(string $name) : bool`

##### Parameters

$name : string

  String of the global name to check

##### Tags

throws
  Throwable

  Throws exception if validation error occurs

##### Return values

bool —

Returns true if global is valid

#### checkInterface()

PHPSandbox.php : 6319

Check interface name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.

`public checkInterface(string $name) : bool`

##### Parameters

$name : string

  String of the interface name to check

##### Tags

throws
  Throwable

  Throws exception if validation error occurs

##### Return values

bool —

Returns true if interface is valid

#### checkKeyword()

PHPSandbox.php : 6395

Check keyword name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.

`public checkKeyword(string $name) : bool`

##### Parameters

$name : string

  String of the keyword name to check

##### Tags

throws
  Throwable

  Throws exception if validation error occurs

##### Return values

bool —

Returns true if keyword is valid

#### checkMagicConst()

PHPSandbox.php : 6150

Check magic constant name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.

`public checkMagicConst(string $name) : bool`

##### Parameters

$name : string

  String of the magic constant name to check

##### Tags

throws
  Throwable

  Throws exception if validation error occurs

##### Return values

bool —

Returns true if magic constant is valid

#### checkNamespace()

PHPSandbox.php : 6188

Check namespace name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.

`public checkNamespace(string $name) : bool`

##### Parameters

$name : string

  String of the namespace name to check

##### Tags

throws
  Throwable

  Throws exception if validation error occurs

##### Return values

bool —

Returns true if namespace is valid

#### checkOperator()

PHPSandbox.php : 6429

Check operator name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.

`public checkOperator(string $name) : bool`

##### Parameters

$name : string

  String of the type operator to check

##### Tags

throws
  Throwable

  Throws exception if validation error occurs

##### Return values

bool —

Returns true if operator is valid

#### checkPrimitive()

PHPSandbox.php : 6463

Check primitive name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.

`public checkPrimitive(string $name) : bool`

##### Parameters

$name : string

  String of the primitive name to check

##### Tags

throws
  Throwable

  Throws exception if validation error occurs

##### Return values

bool —

Returns true if primitive is valid

#### checkSuperglobal()

PHPSandbox.php : 6069

Check superglobal name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.

`public checkSuperglobal(string $name) : bool`

##### Parameters

$name : string

  String of the superglobal name to check

##### Tags

throws
  Throwable

  Throws exception if validation error occurs

##### Return values

bool —

Returns true if superglobal is valid

#### checkTrait()

PHPSandbox.php : 6357

Check trait name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.

`public checkTrait(string $name) : bool`

##### Parameters

$name : string

  String of the trait name to check

##### Tags

throws
  Throwable

  Throws exception if validation error occurs

##### Return values

bool —

Returns true if trait is valid

#### checkType()

PHPSandbox.php : 6497

Check type name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.

`public checkType(string $name) : bool`

##### Parameters

$name : string

  String of the type name to check

##### Tags

throws
  Throwable

  Throws exception if validation error occurs

##### Return values

bool —

Returns true if type is valid

#### checkUse()

PHPSandbox.php : 6265

Check use (or alias) name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.

`public checkUse(string $name) : bool`

##### Parameters

$name : string

  String of the use (or alias) name to check

##### Tags

alias

  checkAlias();

throws
  Throwable

  Throws exception if validation error occurs

##### Return values

bool —

Returns true if use (or alias) is valid

#### checkVar()

PHPSandbox.php : 5997

Check variable name against PHPSandbox validation rules. This is an internal PHPSandbox function but requires public access to work.

`public checkVar(string $name) : bool`

##### Parameters

$name : string

  String of the variable name to check

##### Tags

throws
  Throwable

  Throws exception if validation error occurs

##### Return values

bool —

Returns true if variable is valid

#### clear()

PHPSandbox.php : 6731

Clear all trusted and sandboxed code

`public clear() : PHPSandbox`

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### clear_append()

PHPSandbox.php : 0
`public clear_append() :`

##### Return values

—

#### clear_code()

PHPSandbox.php : 0
`public clear_code() :`

##### Return values

—

#### clear_prepend()

PHPSandbox.php : 0
`public clear_prepend() :`

##### Return values

—

#### clear_trusted_code()

PHPSandbox.php : 0
`public clear_trusted_code() :`

##### Return values

—

#### clearAppend()

PHPSandbox.php : 6772

Clear all appended trusted code

`public clearAppend() : PHPSandbox`

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### clearAppendedCode()

PHPSandbox.php : 6783

Clear all appended trusted code

`public clearAppendedCode() : PHPSandbox`

##### Tags

alias

  $this->clearAppend()

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### clearCode()

PHPSandbox.php : 6792

Clear generated code

`public clearCode() : PHPSandbox`

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### clearPrepended()

PHPSandbox.php : 6752

Clear all prepended trusted code

`public clearPrepended() : PHPSandbox`

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### clearPrependedCode()

PHPSandbox.php : 6763

Clear all prepended trusted code

`public clearPrependedCode() : PHPSandbox`

##### Tags

alias

  $this->clearPrepended()

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### clearTrustedCode()

PHPSandbox.php : 6742

Clear all trusted code

`public clearTrustedCode() : PHPSandbox`

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### create()

PHPSandbox.php : 891

PHPSandbox static factory method

`public static create([array<string|int, mixed> $options = [] ][, array<string|int, mixed> $functions = [] ][, array<string|int, mixed> $variables = [] ][, array<string|int, mixed> $constants = [] ][, array<string|int, mixed> $namespaces = [] ][, array<string|int, mixed> $aliases = [] ][, array<string|int, mixed> $superglobals = [] ][, array<string|int, mixed> $magic_constants = [] ][, array<string|int, mixed> $classes = [] ][, array<string|int, mixed> $interfaces = [] ][, array<string|int, mixed> $traits = [] ]) : PHPSandbox`

You can pass optional arrays of predefined functions, variables, etc. to the sandbox through the constructor

##### Parameters

$options : array<string|int, mixed> = []

  Optional array of options to set for the sandbox

$functions : array<string|int, mixed> = []

  Optional array of functions to define for the sandbox

$variables : array<string|int, mixed> = []

  Optional array of variables to define for the sandbox

$constants : array<string|int, mixed> = []

  Optional array of constants to define for the sandbox

$namespaces : array<string|int, mixed> = []

  Optional array of namespaces to define for the sandbox

$aliases : array<string|int, mixed> = []

  Optional array of aliases to define for the sandbox

$superglobals : array<string|int, mixed> = []

  Optional array of superglobals to define for the sandbox

$magic_constants : array<string|int, mixed> = []

  Optional array of magic constants to define for the sandbox

$classes : array<string|int, mixed> = []

  Optional array of classes to define for the sandbox

$interfaces : array<string|int, mixed> = []

  Optional array of interfaces to define for the sandbox

$traits : array<string|int, mixed> = []

  Optional array of traits to define for the sandbox

##### Return values

PHPSandbox —

The returned PHPSandbox variable

#### deblacklist()

PHPSandbox.php : 4129

Remove PHPSandbox definitions, such as functions, constants, classes, etc. from blacklist

`public deblacklist(string|array<string|int, mixed> $type, string|array<string|int, mixed>|null $name) : PHPSandbox`

You can pass an associative array of blacklist types and their names, or a string $type and array of $names, or pass a string of the $type and $name to unset

##### Parameters

$type : string|array<string|int, mixed>

  Associative array or string of blacklist type to unset

$name : string|array<string|int, mixed>|null

  Array or string of blacklist name to unset

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### deblacklist_alias()

PHPSandbox.php : 0
`public deblacklist_alias() :`

##### Return values

—

#### deblacklist_class()

PHPSandbox.php : 0
`public deblacklist_class() :`

##### Return values

—

#### deblacklist_const()

PHPSandbox.php : 0
`public deblacklist_const() :`

##### Return values

—

#### deblacklist_func()

PHPSandbox.php : 0
`public deblacklist_func() :`

##### Return values

—

#### deblacklist_global()

PHPSandbox.php : 0
`public deblacklist_global() :`

##### Return values

—

#### deblacklist_interface()

PHPSandbox.php : 0
`public deblacklist_interface() :`

##### Return values

—

#### deblacklist_keyword()

PHPSandbox.php : 0
`public deblacklist_keyword() :`

##### Return values

—

#### deblacklist_magic_const()

PHPSandbox.php : 0
`public deblacklist_magic_const() :`

##### Return values

—

#### deblacklist_namespace()

PHPSandbox.php : 0
`public deblacklist_namespace() :`

##### Return values

—

#### deblacklist_operator()

PHPSandbox.php : 0
`public deblacklist_operator() :`

##### Return values

—

#### deblacklist_primitive()

PHPSandbox.php : 0
`public deblacklist_primitive() :`

##### Return values

—

#### deblacklist_superglobal()

PHPSandbox.php : 0
`public deblacklist_superglobal() :`

##### Return values

—

#### deblacklist_trait()

PHPSandbox.php : 0
`public deblacklist_trait() :`

##### Return values

—

#### deblacklist_type()

PHPSandbox.php : 0
`public deblacklist_type() :`

##### Return values

—

#### deblacklist_use()

PHPSandbox.php : 0
`public deblacklist_use() :`

##### Return values

—

#### deblacklist_var()

PHPSandbox.php : 0
`public deblacklist_var() :`

##### Return values

—

#### deblacklistAlias()

PHPSandbox.php : 5424

Remove alias from blacklist

`public deblacklistAlias(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of alias name, or pass an array of the alias names to remove from blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of alias name or array of alias names to remove from blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### deblacklistClass()

PHPSandbox.php : 5556

Remove class from blacklist

`public deblacklistClass(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of class name, or pass an array of the class names to remove from blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of class name or array of class names to remove from blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### deblacklistConst()

PHPSandbox.php : 5233

Remove constant from blacklist

`public deblacklistConst(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of constant name, or pass an array of the constant names to remove from blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of constant name or array of constant names to remove from blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### deblacklistFunc()

PHPSandbox.php : 4862

Remove function from blacklist

`public deblacklistFunc(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of the function name, or pass an array of function names to remove from blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of function name or array of function names to remove from blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### deblacklistGlobal()

PHPSandbox.php : 4983

Remove global from blacklist

`public deblacklistGlobal(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of global name, or pass an array of the global names to remove from blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of global name or array of global names to remove from blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### deblacklistInterface()

PHPSandbox.php : 5620

Remove interface from blacklist

`public deblacklistInterface(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of interface name, or pass an array of the interface names to remove from blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of interface name or array of interface names to remove from blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### deblacklistKeyword()

PHPSandbox.php : 5748

Remove keyword from blacklist

`public deblacklistKeyword(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of keyword name, or pass an array of the keyword names to remove from blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of keyword name or array of keyword names to remove from blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### deblacklistMagicConst()

PHPSandbox.php : 5296

Remove magic constant from blacklist

`public deblacklistMagicConst(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of magic constant name, or pass an array of the magic constant names to remove from blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of magic constant name or array of magic constant names to remove from blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### deblacklistNamespace()

PHPSandbox.php : 5360

Remove namespace from blacklist

`public deblacklistNamespace(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of namespace name, or pass an array of the namespace names to remove from blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of namespace name or array of namespace names to remove from blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### deblacklistOperator()

PHPSandbox.php : 5812

Remove operator from blacklist

`public deblacklistOperator(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of operator name, or pass an array of the operator names to remove from blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of operator name or array of operator names to remove from blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### deblacklistPrimitive()

PHPSandbox.php : 5876

Remove primitive from blacklist

`public deblacklistPrimitive(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of primitive name, or pass an array of the primitive names to remove from blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of primitive name or array of primitive names to remove from blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### deblacklistSuperglobal()

PHPSandbox.php : 5146

Remove superglobal or superglobal key from blacklist * You can pass a string of the superglobal name, or a string of the superglobal name and a string of the key, or pass an array of superglobal names, or an associative array of superglobal names and their keys to remove from blacklist

`public deblacklistSuperglobal(string|array<string|int, mixed> $name[, string|null $key = null ]) : PHPSandbox`

##### Parameters

$name : string|array<string|int, mixed>

  String of superglobal name, or an array of superglobal names, or an associative array of superglobal names and their keys to remove from blacklist

$key : string|null = null

  String of superglobal key to remove from blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### deblacklistTrait()

PHPSandbox.php : 5684

Remove trait from blacklist

`public deblacklistTrait(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of trait name, or pass an array of the trait names to remove from blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of trait name or array of trait names to remove from blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### deblacklistType()

PHPSandbox.php : 5940

Remove type from blacklist

`public deblacklistType(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of type name, or pass an array of the type names to remove from blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of type name or array of type names to remove from blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### deblacklistUse()

PHPSandbox.php : 5493

Remove use (or alias) from blacklist

`public deblacklistUse(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of use (or alias name, or pass an array of the use (or alias) names to remove from blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of use (or alias) name or array of use (or alias) names to remove from blacklist

##### Tags

alias

  deblacklistAlias();

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### deblacklistVar()

PHPSandbox.php : 4923

Remove function from blacklist

`public deblacklistVar(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of variable name, or pass an array of the variable names to remove from blacklist

##### Parameters

$name : string|array<string|int, mixed>

  String of variable name or array of variable names to remove from blacklist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### define()

PHPSandbox.php : 2555

Define PHPSandbox definitions, such as functions, constants, namespaces, etc.

`public define(string|array<string|int, mixed> $type[, string|array<string|int, mixed>|null $name = null ][, mixed|null $value = null ]) : PHPSandbox`

You can pass a string of the $type, $name and $value, or pass an associative array of definitions types and an associative array of their corresponding values

##### Parameters

$type : string|array<string|int, mixed>

  Associative array or string of definition type to define

$name : string|array<string|int, mixed>|null = null

  Associative array or string of definition name to define

$value : mixed|null = null

  Value of definition to define

##### Tags

throws
  Throwable

  Throws exception if definition fails

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### define_alias()

PHPSandbox.php : 0
`public define_alias() :`

##### Return values

—

#### define_aliases()

PHPSandbox.php : 0
`public define_aliases() :`

##### Return values

—

#### define_class()

PHPSandbox.php : 0
`public define_class() :`

##### Return values

—

#### define_classes()

PHPSandbox.php : 0
`public define_classes() :`

##### Return values

—

#### define_const()

PHPSandbox.php : 0
`public define_const() :`

##### Return values

—

#### define_consts()

PHPSandbox.php : 0
`public define_consts() :`

##### Return values

—

#### define_func()

PHPSandbox.php : 0
`public define_func() :`

##### Return values

—

#### define_funcs()

PHPSandbox.php : 0
`public define_funcs() :`

##### Return values

—

#### define_interface()

PHPSandbox.php : 0
`public define_interface() :`

##### Return values

—

#### define_interfaces()

PHPSandbox.php : 0
`public define_interfaces() :`

##### Return values

—

#### define_magic_const()

PHPSandbox.php : 0
`public define_magic_const() :`

##### Return values

—

#### define_magic_consts()

PHPSandbox.php : 0
`public define_magic_consts() :`

##### Return values

—

#### define_namespace()

PHPSandbox.php : 0
`public define_namespace() :`

##### Return values

—

#### define_namespaces()

PHPSandbox.php : 0
`public define_namespaces() :`

##### Return values

—

#### define_superglobal()

PHPSandbox.php : 0
`public define_superglobal() :`

##### Return values

—

#### define_superglobals()

PHPSandbox.php : 0
`public define_superglobals() :`

##### Return values

—

#### define_trait()

PHPSandbox.php : 0
`public define_trait() :`

##### Return values

—

#### define_traits()

PHPSandbox.php : 0
`public define_traits() :`

##### Return values

—

#### define_use()

PHPSandbox.php : 0
`public define_use() :`

##### Return values

—

#### define_uses()

PHPSandbox.php : 0
`public define_uses() :`

##### Return values

—

#### define_var()

PHPSandbox.php : 0
`public define_var() :`

##### Return values

—

#### define_vars()

PHPSandbox.php : 0
`public define_vars() :`

##### Return values

—

#### defineAlias()

PHPSandbox.php : 3273

Define PHPSandbox alias

`public defineAlias(string|array<string|int, mixed> $name[, string|null $alias = null ]) : PHPSandbox`

You can pass the namespace $name and $alias to use, an array of namespaces to use, or an associative array of namespaces to use and their aliases

##### Parameters

$name : string|array<string|int, mixed>

  String of namespace $name to use, or an array of namespaces to use, or an associative array of namespaces and their aliases to use

$alias : string|null = null

  String of $alias to use

##### Tags

throws
  Throwable

  Throws exception if unnamed namespace is used

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### defineAliases()

PHPSandbox.php : 3296

Define PHPSandbox aliases by array

`public defineAliases([array<string|int, mixed> $aliases = [] ]) : PHPSandbox`

You can pass an array of namespaces to use, or an associative array of namespaces to use and their aliases

##### Parameters

$aliases : array<string|int, mixed> = []

  Array of namespaces to use, or an associative array of namespaces and their aliases to use

##### Tags

throws
  Throwable

  Throws exception if unnamed namespace is used

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### defineClass()

PHPSandbox.php : 3452

Define PHPSandbox class

`public defineClass(string|array<string|int, mixed> $name, mixed $value) : PHPSandbox`

You can pass the class $name and $value to define, or an associative array of classes to define

##### Parameters

$name : string|array<string|int, mixed>

  String of class $name or associative array to define

$value : mixed

  Value to define class to

##### Tags

throws
  Throwable

  Throws exception if unnamed class is defined

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### defineClasses()

PHPSandbox.php : 3472

Define PHPSandbox classes by array

`public defineClasses([array<string|int, mixed> $classes = [] ]) : PHPSandbox`

You can pass an associative array of classes to define

##### Parameters

$classes : array<string|int, mixed> = []

  Associative array of $classes to define

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### defineConst()

PHPSandbox.php : 2976

Define PHPSandbox constant

`public defineConst(string|array<string|int, mixed> $name, mixed $value) : PHPSandbox`

You can pass the constant $name and $value to define, or an associative array of constants to define

##### Parameters

$name : string|array<string|int, mixed>

  String of constant $name or associative array to define

$value : mixed

  Value to define constant to

##### Tags

throws
  Throwable

  Throws exception if unnamed constant is defined

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### defineConsts()

PHPSandbox.php : 2995

Define PHPSandbox constants by array

`public defineConsts([array<string|int, mixed> $constants = [] ]) : PHPSandbox`

You can pass an associative array of constants to define

##### Parameters

$constants : array<string|int, mixed> = []

  Associative array of $constants to define

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### defineFunc()

PHPSandbox.php : 2661

Define PHPSandbox function

`public defineFunc(string|array<string|int, mixed> $name, callable $function[, bool $pass_sandbox = false ]) : PHPSandbox`

You can pass the function $name and $function closure or callable to define, or an associative array of functions to define, which can have callable values or arrays of the function callable and $pass_sandbox flag

##### Parameters

$name : string|array<string|int, mixed>

  Associative array or string of function $name to define

$function : callable

  Callable to define $function to

$pass_sandbox : bool = false

  Pass PHPSandbox instance to defined function when called? Default is false

##### Tags

throws
  Throwable

  Throws exception if unnamed or uncallable $function is defined

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### defineFuncs()

PHPSandbox.php : 2694

Define PHPSandbox functions by array

`public defineFuncs([array<string|int, mixed> $functions = [] ]) : PHPSandbox`

You can pass an associative array of functions to define

##### Parameters

$functions : array<string|int, mixed> = []

  Associative array of $functions to define

##### Tags

throws
  Throwable

  Throws exception if unnamed or uncallable $function is defined

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### defineInterface()

PHPSandbox.php : 3562

Define PHPSandbox interface

`public defineInterface(string|array<string|int, mixed> $name, mixed $value) : PHPSandbox`

You can pass the interface $name and $value to define, or an associative array of interfaces to define

##### Parameters

$name : string|array<string|int, mixed>

  String of interface $name or associative array to define

$value : mixed

  Value to define interface to

##### Tags

throws
  Throwable

  Throws exception if unnamed interface is defined

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### defineInterfaces()

PHPSandbox.php : 3584

Define PHPSandbox interfaces by array

`public defineInterfaces([array<string|int, mixed> $interfaces = [] ]) : PHPSandbox`

You can pass an associative array of interfaces to define

##### Parameters

$interfaces : array<string|int, mixed> = []

  Associative array of $interfaces to define

##### Tags

throws
  Throwable

  Throws exception if unnamed interface is defined

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### defineMagicConst()

PHPSandbox.php : 3068

Define PHPSandbox magic constant

`public defineMagicConst(string|array<string|int, mixed> $name, mixed $value) : PHPSandbox`

You can pass the magic constant $name and $value to define, or an associative array of magic constants to define

##### Parameters

$name : string|array<string|int, mixed>

  String of magic constant $name or associative array to define

$value : mixed

  Value to define magic constant to, can be callable

##### Tags

throws
  Throwable

  Throws exception if unnamed magic constant is defined

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### defineMagicConsts()

PHPSandbox.php : 3088

Define PHPSandbox magic constants by array

`public defineMagicConsts([array<string|int, mixed> $magic_constants = [] ]) : PHPSandbox`

You can pass an associative array of magic constants to define

##### Parameters

$magic_constants : array<string|int, mixed> = []

  Associative array of $magic_constants to define

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### defineNamespace()

PHPSandbox.php : 3162

Define PHPSandbox namespace

`public defineNamespace(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass the namespace $name and $value to define, or an array of namespaces to define

##### Parameters

$name : string|array<string|int, mixed>

  String of namespace $name, or an array of namespace names to define

##### Tags

throws
  Throwable

  Throws exception if unnamed namespace is defined

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### defineNamespaces()

PHPSandbox.php : 3182

Define PHPSandbox namespaces by array

`public defineNamespaces([array<string|int, mixed> $namespaces = [] ]) : PHPSandbox`

You can pass an array of namespaces to define

##### Parameters

$namespaces : array<string|int, mixed> = []

  Array of $namespaces to define

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### defineSuperglobal()

PHPSandbox.php : 2863

Define PHPSandbox superglobal

`public defineSuperglobal(string|array<string|int, mixed> $name, mixed $value) : PHPSandbox`

You can pass the superglobal $name and $value to define, or an associative array of superglobals to define, or a third variable to define the $key

##### Parameters

$name : string|array<string|int, mixed>

  String of superglobal $name or associative array of superglobal names to define

$value : mixed

  Value to define superglobal to, can be callable

##### Tags

throws
  Throwable

  Throws exception if unnamed superglobal is defined

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### defineSuperglobals()

PHPSandbox.php : 2889

Define PHPSandbox superglobals by array

`public defineSuperglobals([array<string|int, mixed> $superglobals = [] ]) : PHPSandbox`

You can pass an associative array of superglobals to define

##### Parameters

$superglobals : array<string|int, mixed> = []

  Associative array of $superglobals to define

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### defineTrait()

PHPSandbox.php : 3675

Define PHPSandbox trait

`public defineTrait(string|array<string|int, mixed> $name, mixed $value) : PHPSandbox`

You can pass the trait $name and $value to define, or an associative array of traits to define

##### Parameters

$name : string|array<string|int, mixed>

  String of trait $name or associative array to define

$value : mixed

  Value to define trait to

##### Tags

throws
  Throwable

  Throws exception if unnamed trait is defined

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### defineTraits()

PHPSandbox.php : 3695

Define PHPSandbox traits by array

`public defineTraits([array<string|int, mixed> $traits = [] ]) : PHPSandbox`

You can pass an associative array of traits to define

##### Parameters

$traits : array<string|int, mixed> = []

  Associative array of $traits to define

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### defineUse()

PHPSandbox.php : 3373

Define PHPSandbox use (or alias)

`public defineUse(string|array<string|int, mixed> $name[, string|null $alias = null ]) : PHPSandbox`

##### Parameters

$name : string|array<string|int, mixed>

  String of namespace $name to use, or or an array of namespaces to use, or an associative array of namespaces and their aliases to use

$alias : string|null = null

  String of $alias to use

##### Tags

alias

  defineAlias();

  You can pass the namespace $name and $alias to use, an array of namespaces to use, or an associative array of namespaces to use and their aliases

throws
  Throwable

  Throws exception if unnamed namespace is used

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### defineUses()

PHPSandbox.php : 3389

Define PHPSandbox uses (or aliases) by array

`public defineUses([array<string|int, mixed> $uses = [] ]) : PHPSandbox`

##### Parameters

$uses : array<string|int, mixed> = []

  Array of namespaces to use, or an associative array of namespaces and their aliases to use

##### Tags

alias

  defineAliases();

  You can pass an array of namespaces to use, or an associative array of namespaces to use and their aliases

throws
  Throwable

  Throws exception if unnamed namespace is used

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### defineVar()

PHPSandbox.php : 2769

Define PHPSandbox variable

`public defineVar(string|array<string|int, mixed> $name, mixed $value) : PHPSandbox`

You can pass the variable $name and $value to define, or an associative array of variables to define

##### Parameters

$name : string|array<string|int, mixed>

  String of variable $name or associative array to define

$value : mixed

  Value to define variable to

##### Tags

throws
  Throwable

  Throws exception if unnamed variable is defined

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### defineVars()

PHPSandbox.php : 2790

Define PHPSandbox variables by array

`public defineVars([array<string|int, mixed> $variables = [] ]) : PHPSandbox`

You can pass an associative array of variables to define

##### Parameters

$variables : array<string|int, mixed> = []

  Associative array of $variables to define

##### Tags

throws
  Throwable

  Throws exception if unnamed variable is defined

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### dewhitelist()

PHPSandbox.php : 4101

Remove PHPSandbox definitions, such as functions, constants, classes, etc. from whitelist

`public dewhitelist(string|array<string|int, mixed> $type, string|array<string|int, mixed>|null $name) : PHPSandbox`

You can pass an associative array of whitelist types and their names, or a string $type and array of $names, or pass a string of the $type and $name to unset

##### Parameters

$type : string|array<string|int, mixed>

  Associative array or string of whitelist type to unset

$name : string|array<string|int, mixed>|null

  Array or string of whitelist name to unset

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### dewhitelist_alias()

PHPSandbox.php : 0
`public dewhitelist_alias() :`

##### Return values

—

#### dewhitelist_class()

PHPSandbox.php : 0
`public dewhitelist_class() :`

##### Return values

—

#### dewhitelist_const()

PHPSandbox.php : 0
`public dewhitelist_const() :`

##### Return values

—

#### dewhitelist_func()

PHPSandbox.php : 0
`public dewhitelist_func() :`

##### Return values

—

#### dewhitelist_global()

PHPSandbox.php : 0
`public dewhitelist_global() :`

##### Return values

—

#### dewhitelist_interface()

PHPSandbox.php : 0
`public dewhitelist_interface() :`

##### Return values

—

#### dewhitelist_keyword()

PHPSandbox.php : 0
`public dewhitelist_keyword() :`

##### Return values

—

#### dewhitelist_magic_const()

PHPSandbox.php : 0
`public dewhitelist_magic_const() :`

##### Return values

—

#### dewhitelist_namespace()

PHPSandbox.php : 0
`public dewhitelist_namespace() :`

##### Return values

—

#### dewhitelist_operator()

PHPSandbox.php : 0
`public dewhitelist_operator() :`

##### Return values

—

#### dewhitelist_primitive()

PHPSandbox.php : 0
`public dewhitelist_primitive() :`

##### Return values

—

#### dewhitelist_superglobal()

PHPSandbox.php : 0
`public dewhitelist_superglobal() :`

##### Return values

—

#### dewhitelist_trait()

PHPSandbox.php : 0
`public dewhitelist_trait() :`

##### Return values

—

#### dewhitelist_type()

PHPSandbox.php : 0
`public dewhitelist_type() :`

##### Return values

—

#### dewhitelist_use()

PHPSandbox.php : 0
`public dewhitelist_use() :`

##### Return values

—

#### dewhitelist_var()

PHPSandbox.php : 0
`public dewhitelist_var() :`

##### Return values

—

#### dewhitelistAlias()

PHPSandbox.php : 5408

Remove alias from whitelist

`public dewhitelistAlias(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of alias name, or pass an array of the alias names to remove from whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of alias name or array of alias names to remove from whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### dewhitelistClass()

PHPSandbox.php : 5540

Remove class from whitelist

`public dewhitelistClass(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of class name, or pass an array of the class names to remove from whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of class name or array of class names to remove from whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### dewhitelistConst()

PHPSandbox.php : 5218

Remove constant from whitelist

`public dewhitelistConst(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of constant name, or pass an array of the constant names to remove from whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of constant name or array of constant names to remove from whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### dewhitelistFunc()

PHPSandbox.php : 4846

Remove function from whitelist

`public dewhitelistFunc(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of the function name, or pass an array of function names to remove from whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of function name or array of function names to remove from whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### dewhitelistGlobal()

PHPSandbox.php : 4968

Remove global from whitelist

`public dewhitelistGlobal(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of global name, or pass an array of the global names to remove from whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of global name or array of global names to remove from whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### dewhitelistInterface()

PHPSandbox.php : 5604

Remove interface from whitelist

`public dewhitelistInterface(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of interface name, or pass an array of the interface names to remove from whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of interface name or array of interface names to remove from whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### dewhitelistKeyword()

PHPSandbox.php : 5732

Remove keyword from whitelist

`public dewhitelistKeyword(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of keyword name, or pass an array of the keyword names to remove from whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of keyword name or array of keyword names to remove from whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### dewhitelistMagicConst()

PHPSandbox.php : 5280

Remove magic constant from whitelist

`public dewhitelistMagicConst(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of magic constant name, or pass an array of the magic constant names to remove from whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of magic constant name or array of magic constant names to remove from whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### dewhitelistNamespace()

PHPSandbox.php : 5344

Remove namespace from whitelist

`public dewhitelistNamespace(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of namespace name, or pass an array of the namespace names to remove from whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of namespace name or array of namespace names to remove from whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### dewhitelistOperator()

PHPSandbox.php : 5796

Remove operator from whitelist

`public dewhitelistOperator(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of operator name, or pass an array of the operator names to remove from whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of operator name or array of operator names to remove from whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### dewhitelistPrimitive()

PHPSandbox.php : 5860

Remove primitive from whitelist

`public dewhitelistPrimitive(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of primitive name, or pass an array of the primitive names to remove from whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of primitive name or array of primitive names to remove from whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### dewhitelistSuperglobal()

PHPSandbox.php : 5102

Remove superglobal or superglobal key from whitelist * You can pass a string of the superglobal name, or a string of the superglobal name and a string of the key, or pass an array of superglobal names, or an associative array of superglobal names and their keys to remove from whitelist

`public dewhitelistSuperglobal(string|array<string|int, mixed> $name[, string|null $key = null ]) : PHPSandbox`

##### Parameters

$name : string|array<string|int, mixed>

  String of superglobal name, or an array of superglobal names, or an associative array of superglobal names and their keys to remove from whitelist

$key : string|null = null

  String of superglobal key to remove from whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### dewhitelistTrait()

PHPSandbox.php : 5668

Remove trait from whitelist

`public dewhitelistTrait(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of trait name, or pass an array of the trait names to remove from whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of trait name or array of trait names to remove from whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### dewhitelistType()

PHPSandbox.php : 5924

Remove type from whitelist

`public dewhitelistType(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of type name, or pass an array of the type names to remove from whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of type name or array of type names to remove from whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### dewhitelistUse()

PHPSandbox.php : 5476

Remove use (or alias) from whitelist

`public dewhitelistUse(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of use (or alias name, or pass an array of the use (or alias) names to remove from whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of use (or alias) name or array of use (or alias) names to remove from whitelist

##### Tags

alias

  dewhitelistAlias();

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### dewhitelistVar()

PHPSandbox.php : 4908

Remove variable from whitelist

`public dewhitelistVar(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of variable name, or pass an array of the variable names to remove from whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of variable name or array of variable names to remove from whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### error()

PHPSandbox.php : 7066

Invoke sandbox error handler

`public error(int $errno, string $errstr, string $errfile, int $errline[, array<string|int, mixed> $errcontext = [] ]) : mixed`

##### Parameters

$errno : int

  Error number

$errstr : string

  Error message

$errfile : string

  Error file

$errline : int

  Error line number

$errcontext : array<string|int, mixed> = []

  Error context array

##### Tags

throws
  Throwable

##### Return values

mixed —

#### exception()

PHPSandbox.php : 7127

Invoke sandbox exception handler

`public exception(Throwable $exception) : mixed`

##### Parameters

$exception : Throwable

  Exception to be handled

##### Tags

throws
  Throwable

##### Return values

mixed —

#### execute()

PHPSandbox.php : 6962

Prepare and execute callable and return output

`public execute([callable|string $callable = null ][, bool $skip_validation = false ][, string|null $executing_file = null ]) : mixed`

This function validates your code and automatically whitelists it according to your specified configuration, then executes it.

##### Parameters

$callable : callable|string = null

  Callable or string of PHP code to prepare and execute within the sandbox

$skip_validation : bool = false

  Boolean flag to indicate whether the sandbox should skip validation of the pass callable. Default is false.

$executing_file : string|null = null

  The file path of the code to execute

##### Tags

throws
  Throwable

  Throws exception if error occurs in parsing, validation or whitelisting or if generated closure is invalid

##### Return values

mixed —

The output from the executed sandboxed code

#### get_defined_class()

PHPSandbox.php : 0
`public get_defined_class() :`

##### Return values

—

#### get_defined_interface()

PHPSandbox.php : 0
`public get_defined_interface() :`

##### Return values

—

#### get_defined_namespace()

PHPSandbox.php : 0
`public get_defined_namespace() :`

##### Return values

—

#### get_defined_trait()

PHPSandbox.php : 0
`public get_defined_trait() :`

##### Return values

—

#### get_error_handler()

PHPSandbox.php : 0
`public get_error_handler() :`

##### Return values

—

#### get_exception_handler()

PHPSandbox.php : 0
`public get_exception_handler() :`

##### Return values

—

#### get_execution_time()

PHPSandbox.php : 0
`public get_execution_time() :`

##### Return values

—

#### get_last_error()

PHPSandbox.php : 0
`public get_last_error() :`

##### Return values

—

#### get_last_exception()

PHPSandbox.php : 0
`public get_last_exception() :`

##### Return values

—

#### get_last_validation_error()

PHPSandbox.php : 0
`public get_last_validation_error() :`

##### Return values

—

#### get_prepared_time()

PHPSandbox.php : 0
`public get_prepared_time() :`

##### Return values

—

#### get_time()

PHPSandbox.php : 0
`public get_time() :`

##### Return values

—

#### get_validation_error_handler()

PHPSandbox.php : 0
`public get_validation_error_handler() :`

##### Return values

—

#### getAliasValidator()

PHPSandbox.php : 1514

Get validation callable for aliases

`public getAliasValidator() : callable|null`

##### Return values

callable|null —

#### getAppendedCode()

PHPSandbox.php : 1879

Get PHPSandbox appended code

`public getAppendedCode() : string`

##### Return values

string —

Returns a string of the appended code

#### getClassValidator()

PHPSandbox.php : 1580

Get validation callable for classes

`public getClassValidator() : callable|null`

##### Return values

callable|null —

#### getCode()

PHPSandbox.php : 1923

Get PHPSandbox generated code

`public getCode() : string`

##### Tags

alias

  getGeneratedCode();

##### Return values

string —

Returns a string of the generated code

#### getConstValidator()

PHPSandbox.php : 1421

Get validation callable for constants

`public getConstValidator() : callable|null`

##### Return values

callable|null —

#### getDefinedClass()

PHPSandbox.php : 3505

Get defined class of $name

`public getDefinedClass(string $name) : string`

##### Parameters

$name : string

  String of class $name to get

##### Tags

throws
  Throwable

  Throws an exception if an invalid class name is requested

##### Return values

string —

Returns string of defined class value

#### getDefinedInterface()

PHPSandbox.php : 3618

Get defined interface of $name

`public getDefinedInterface(string $name) : string`

##### Parameters

$name : string

  String of interface $name to get

##### Tags

throws
  Throwable

  Throws an exception if an invalid interface name is requested

##### Return values

string —

Returns string of defined interface value

#### getDefinedNamespace()

PHPSandbox.php : 3216

Get defined namespace of $name

`public getDefinedNamespace(string $name) : string`

##### Parameters

$name : string

  String of namespace $name to get

##### Tags

throws
  Throwable

  Throws an exception if an invalid namespace name is requested

##### Return values

string —

Returns string of defined namespace value

#### getDefinedTrait()

PHPSandbox.php : 3729

Get defined trait of $name

`public getDefinedTrait(string $name) : string`

##### Parameters

$name : string

  String of trait $name to get

##### Tags

throws
  Throwable

  Throws an exception if an invalid trait name is requested

##### Return values

string —

Returns string of defined trait value

#### getErrorHandler()

PHPSandbox.php : 7032

Get error handler

`public getErrorHandler() : callable|null`

This function returns the sandbox error handler.

##### Return values

callable|null —

#### getExceptionHandler()

PHPSandbox.php : 7097

Get exception handler

`public getExceptionHandler() : callable|null`

This function returns the sandbox exception handler.

##### Return values

callable|null —

#### getExecutingFile()

PHPSandbox.php : 6836

Return the current file being executed in the sandbox

`public getExecutingFile() : string|null`

##### Return values

string|null —

The current file being executed

#### getExecutionTime()

PHPSandbox.php : 6817

Return the amount of time the sandbox spent executing the sandboxed code

`public getExecutionTime(int $round) : float`

You can pass the number of digits you wish to round the return value

##### Parameters

$round : int

  The number of digits to round the return value

##### Return values

float —

The amount of time in microseconds it took to execute the sandboxed code

#### getFuncValidator()

PHPSandbox.php : 1297

Get validation for functions

`public getFuncValidator() : callable|null`

##### Return values

callable|null —

#### getGeneratedCode()

PHPSandbox.php : 1914

Get PHPSandbox generated code

`public getGeneratedCode() : string`

##### Return values

string —

Returns a string of the generated code

#### getGlobalValidator()

PHPSandbox.php : 1359

Get validation callable for globals

`public getGlobalValidator() : callable|null`

##### Return values

callable|null —

#### getInterfaceValidator()

PHPSandbox.php : 1611

Get validation callable for interfaces

`public getInterfaceValidator() : callable|null`

##### Return values

callable|null —

#### getIterator()

PHPSandbox.php : 7219

Get an iterator of all the public PHPSandbox properties

`public getIterator() : ArrayIterator`

##### Return values

ArrayIterator —

#### getKeywordValidator()

PHPSandbox.php : 1673

Get validation callable for keywords

`public getKeywordValidator() : callable|null`

##### Return values

callable|null —

#### getLastError()

PHPSandbox.php : 7050

Gets the last sandbox error

`public getLastError() : array<string|int, mixed>|null`

##### Return values

array<string|int, mixed>|null —

#### getLastException()

PHPSandbox.php : 7115

Gets the last exception thrown by the sandbox

`public getLastException() : Throwable|null`

##### Return values

Throwable|null —

#### getLastValidationError()

PHPSandbox.php : 7174

Gets the last validation error thrown by the sandbox

`public getLastValidationError() : Throwable|null`

##### Return values

Throwable|null —

#### getMagicConstValidator()

PHPSandbox.php : 1452

Get validation callable for magic constants

`public getMagicConstValidator() : callable|null`

##### Return values

callable|null —

#### getMemoryUsage()

PHPSandbox.php : 6860

Return the amount of bytes the sandbox allocated while preparing and executing the sandboxed code

`public getMemoryUsage(int $round) : float`

You can pass the number of digits you wish to round the return value

##### Parameters

$round : int

  The number of digits to round the return value

##### Return values

float —

The amount of bytes in memory it took to prepare and execute the sandboxed code

#### getName()

PHPSandbox.php : 1054

Get name of PHPSandbox variable

`public getName() : string`

##### Return values

string —

The name of the PHPSandbox variable

#### getNamespaceValidator()

PHPSandbox.php : 1483

Get validation callable for namespaces

`public getNamespaceValidator() : callable|null`

##### Return values

callable|null —

#### getOperatorValidator()

PHPSandbox.php : 1704

Get validation callable for operators

`public getOperatorValidator() : callable|null`

##### Return values

callable|null —

#### getOption()

PHPSandbox.php : 1176

Get PHPSandbox option

`public getOption(string $option) : bool|int|null`

You pass a string $option name to get its associated value

##### Parameters

$option : string

  String of $option name to get

##### Return values

bool|int|null —

Returns the value of the requested option

#### getParsedAST()

PHPSandbox.php : 1893

Get PHPSandbox parsed AST array

`public getParsedAST() : array<string|int, mixed>`

##### Return values

array<string|int, mixed> —

Returns an array of the parsed AST code

#### getPreparedAST()

PHPSandbox.php : 1907

Get PHPSandbox prepared AST array

`public getPreparedAST() : array<string|int, mixed>`

##### Return values

array<string|int, mixed> —

Returns an array of the prepared AST code

#### getPreparedCode()

PHPSandbox.php : 1900

Get PHPSandbox prepared code

`public getPreparedCode() : string`

##### Return values

string —

Returns a string of the prepared code

#### getPreparedTime()

PHPSandbox.php : 6805

Return the amount of time the sandbox spent preparing the sandboxed code

`public getPreparedTime(int $round) : float`

You can pass the number of digits you wish to round the return value

##### Parameters

$round : int

  The number of digits to round the return value

##### Return values

float —

The amount of time in microseconds it took to prepare the sandboxed code

#### getPreparsedCode()

PHPSandbox.php : 1886

Get PHPSandbox preparsed code

`public getPreparsedCode() : string`

##### Return values

string —

Returns a string of the preparsed code

#### getPrependedCode()

PHPSandbox.php : 1872

Get PHPSandbox prepended code

`public getPrependedCode() : string`

##### Return values

string —

Returns a string of the prepended code

#### getPrimitiveValidator()

PHPSandbox.php : 1735

Get validation callable for primitives

`public getPrimitiveValidator() : callable|null`

##### Return values

callable|null —

#### getSandbox()

PHPSandbox.php : 7212

Get a named PHPSandbox instance (used to retrieve the sandbox instance from within sandboxed code)

`public static getSandbox(string $name) : PHPSandbox|null`

##### Parameters

$name : string

  The name of the PHPSandbox instance to retrieve

##### Return values

PHPSandbox|null —

#### getSuperglobalValidator()

PHPSandbox.php : 1390

Get validation callable for superglobals

`public getSuperglobalValidator() : callable|null`

##### Return values

callable|null —

#### getTime()

PHPSandbox.php : 6848

Return the amount of time the sandbox spent preparing and executing the sandboxed code

`public getTime(int $round) : float`

You can pass the number of digits you wish to round the return value

##### Parameters

$round : int

  The number of digits to round the return value

##### Return values

float —

The amount of time in microseconds it took to prepare and execute the sandboxed code

#### getTraitValidator()

PHPSandbox.php : 1642

Get validation callable for traits

`public getTraitValidator() : callable|null`

##### Return values

callable|null —

#### getTypeValidator()

PHPSandbox.php : 1766

Get validation callable for types

`public getTypeValidator() : callable|null`

##### Return values

callable|null —

#### getUseValidator()

PHPSandbox.php : 1548

Get validation callable for uses (aka aliases)

`public getUseValidator() : callable|null`

##### Tags

alias

  getAliasValidator();

##### Return values

callable|null —

#### getValidationErrorHandler()

PHPSandbox.php : 7156

Get validation error handler

`public getValidationErrorHandler() : callable|null`

This function returns the sandbox validation error handler.

##### Return values

callable|null —

#### getValidator()

PHPSandbox.php : 1261

Get validation callable for specified $type

`public getValidator(string $type) : callable|null`

##### Parameters

$type : string

  String of $type to return

##### Return values

callable|null —

#### getVarValidator()

PHPSandbox.php : 1328

Get validation callable for variables

`public getVarValidator() : callable|null`

##### Return values

callable|null —

#### has_blacklist()

PHPSandbox.php : 0
`public has_blacklist() :`

##### Return values

—

#### has_blacklist_aliases()

PHPSandbox.php : 0
`public has_blacklist_aliases() :`

##### Return values

—

#### has_blacklist_classes()

PHPSandbox.php : 0
`public has_blacklist_classes() :`

##### Return values

—

#### has_blacklist_consts()

PHPSandbox.php : 0
`public has_blacklist_consts() :`

##### Return values

—

#### has_blacklist_funcs()

PHPSandbox.php : 0
`public has_blacklist_funcs() :`

##### Return values

—

#### has_blacklist_globals()

PHPSandbox.php : 0
`public has_blacklist_globals() :`

##### Return values

—

#### has_blacklist_interfaces()

PHPSandbox.php : 0
`public has_blacklist_interfaces() :`

##### Return values

—

#### has_blacklist_keywords()

PHPSandbox.php : 0
`public has_blacklist_keywords() :`

##### Return values

—

#### has_blacklist_magic_consts()

PHPSandbox.php : 0
`public has_blacklist_magic_consts() :`

##### Return values

—

#### has_blacklist_namespaces()

PHPSandbox.php : 0
`public has_blacklist_namespaces() :`

##### Return values

—

#### has_blacklist_operators()

PHPSandbox.php : 0
`public has_blacklist_operators() :`

##### Return values

—

#### has_blacklist_primitives()

PHPSandbox.php : 0
`public has_blacklist_primitives() :`

##### Return values

—

#### has_blacklist_superglobals()

PHPSandbox.php : 0
`public has_blacklist_superglobals() :`

##### Return values

—

#### has_blacklist_traits()

PHPSandbox.php : 0
`public has_blacklist_traits() :`

##### Return values

—

#### has_blacklist_types()

PHPSandbox.php : 0
`public has_blacklist_types() :`

##### Return values

—

#### has_blacklist_uses()

PHPSandbox.php : 0
`public has_blacklist_uses() :`

##### Return values

—

#### has_blacklist_vars()

PHPSandbox.php : 0
`public has_blacklist_vars() :`

##### Return values

—

#### has_defined_aliases()

PHPSandbox.php : 0
`public has_defined_aliases() :`

##### Return values

—

#### has_defined_classes()

PHPSandbox.php : 0
`public has_defined_classes() :`

##### Return values

—

#### has_defined_consts()

PHPSandbox.php : 0
`public has_defined_consts() :`

##### Return values

—

#### has_defined_funcs()

PHPSandbox.php : 0
`public has_defined_funcs() :`

##### Return values

—

#### has_defined_interfaces()

PHPSandbox.php : 0
`public has_defined_interfaces() :`

##### Return values

—

#### has_defined_magic_consts()

PHPSandbox.php : 0
`public has_defined_magic_consts() :`

##### Return values

—

#### has_defined_namespaces()

PHPSandbox.php : 0
`public has_defined_namespaces() :`

##### Return values

—

#### has_defined_superglobals()

PHPSandbox.php : 0
`public has_defined_superglobals() :`

##### Return values

—

#### has_defined_traits()

PHPSandbox.php : 0
`public has_defined_traits() :`

##### Return values

—

#### has_defined_uses()

PHPSandbox.php : 0
`public has_defined_uses() :`

##### Return values

—

#### has_defined_vars()

PHPSandbox.php : 0
`public has_defined_vars() :`

##### Return values

—

#### has_whitelist()

PHPSandbox.php : 0
`public has_whitelist() :`

##### Return values

—

#### has_whitelist_aliases()

PHPSandbox.php : 0
`public has_whitelist_aliases() :`

##### Return values

—

#### has_whitelist_classes()

PHPSandbox.php : 0
`public has_whitelist_classes() :`

##### Return values

—

#### has_whitelist_consts()

PHPSandbox.php : 0
`public has_whitelist_consts() :`

##### Return values

—

#### has_whitelist_funcs()

PHPSandbox.php : 0
`public has_whitelist_funcs() :`

##### Return values

—

#### has_whitelist_globals()

PHPSandbox.php : 0
`public has_whitelist_globals() :`

##### Return values

—

#### has_whitelist_interfaces()

PHPSandbox.php : 0
`public has_whitelist_interfaces() :`

##### Return values

—

#### has_whitelist_keywords()

PHPSandbox.php : 0
`public has_whitelist_keywords() :`

##### Return values

—

#### has_whitelist_magic_consts()

PHPSandbox.php : 0
`public has_whitelist_magic_consts() :`

##### Return values

—

#### has_whitelist_namespaces()

PHPSandbox.php : 0
`public has_whitelist_namespaces() :`

##### Return values

—

#### has_whitelist_operators()

PHPSandbox.php : 0
`public has_whitelist_operators() :`

##### Return values

—

#### has_whitelist_primitives()

PHPSandbox.php : 0
`public has_whitelist_primitives() :`

##### Return values

—

#### has_whitelist_superglobals()

PHPSandbox.php : 0
`public has_whitelist_superglobals() :`

##### Return values

—

#### has_whitelist_traits()

PHPSandbox.php : 0
`public has_whitelist_traits() :`

##### Return values

—

#### has_whitelist_types()

PHPSandbox.php : 0
`public has_whitelist_types() :`

##### Return values

—

#### has_whitelist_uses()

PHPSandbox.php : 0
`public has_whitelist_uses() :`

##### Return values

—

#### has_whitelist_vars()

PHPSandbox.php : 0
`public has_whitelist_vars() :`

##### Return values

—

#### hasBlacklist()

PHPSandbox.php : 4164

Query whether PHPSandbox instance has blacklist type.

`public hasBlacklist(string $type) : int`

##### Parameters

$type : string

  The blacklist type to query

##### Return values

int —

Returns the number of blacklists this instance has defined

#### hasBlacklistedAliases()

PHPSandbox.php : 4470

Query whether PHPSandbox instance has blacklisted aliases.

`public hasBlacklistedAliases() : int`

##### Return values

int —

Returns the number of blacklisted aliases this instance has defined

#### hasBlacklistedClasses()

PHPSandbox.php : 4552

Query whether PHPSandbox instance has blacklisted classes.

`public hasBlacklistedClasses() : int`

##### Return values

int —

Returns the number of blacklisted classes this instance has defined

#### hasBlacklistedConsts()

PHPSandbox.php : 4358

Query whether PHPSandbox instance has blacklisted constants.

`public hasBlacklistedConsts() : int`

##### Return values

int —

Returns the number of blacklisted constants this instance has defined

#### hasBlacklistedFuncs()

PHPSandbox.php : 4202

Query whether PHPSandbox instance has blacklisted functions.

`public hasBlacklistedFuncs() : int`

##### Return values

int —

Returns the number of blacklisted functions this instance has defined

#### hasBlacklistedGlobals()

PHPSandbox.php : 4276

Query whether PHPSandbox instance has blacklisted globals.

`public hasBlacklistedGlobals() : int`

##### Return values

int —

Returns the number of blacklisted globals this instance has defined

#### hasBlacklistedInterfaces()

PHPSandbox.php : 4590

Query whether PHPSandbox instance has blacklisted interfaces.

`public hasBlacklistedInterfaces() : int`

##### Return values

int —

Returns the number of blacklisted interfaces this instance has defined

#### hasBlacklistedKeywords()

PHPSandbox.php : 4666

Query whether PHPSandbox instance has blacklisted keywords.

`public hasBlacklistedKeywords() : int`

##### Return values

int —

Returns the number of blacklisted keywords this instance has defined

#### hasBlacklistedMagicConsts()

PHPSandbox.php : 4394

Query whether PHPSandbox instance has blacklisted magic constants.

`public hasBlacklistedMagicConsts() : int`

##### Return values

int —

Returns the number of blacklisted magic constants this instance has defined

#### hasBlacklistedNamespaces()

PHPSandbox.php : 4432

Query whether PHPSandbox instance has blacklisted namespaces.

`public hasBlacklistedNamespaces() : int`

##### Return values

int —

Returns the number of blacklisted namespaces this instance has defined

#### hasBlacklistedOperators()

PHPSandbox.php : 4704

Query whether PHPSandbox instance has blacklisted operators.

`public hasBlacklistedOperators() : int`

##### Return values

int —

Returns the number of blacklisted operators this instance has defined

#### hasBlacklistedPrimitives()

PHPSandbox.php : 4742

Query whether PHPSandbox instance has blacklisted primitives.

`public hasBlacklistedPrimitives() : int`

##### Return values

int —

Returns the number of blacklisted primitives this instance has defined

#### hasBlacklistedSuperglobals()

PHPSandbox.php : 4317

Query whether PHPSandbox instance has blacklisted superglobals, or superglobal keys

`public hasBlacklistedSuperglobals([string|null $name = null ]) : int`

##### Parameters

$name : string|null = null

  The blacklist superglobal key to query

##### Return values

int —

Returns the number of blacklisted superglobals or superglobal keys this instance has defined

#### hasBlacklistedTraits()

PHPSandbox.php : 4628

Query whether PHPSandbox instance has blacklisted traits.

`public hasBlacklistedTraits() : int`

##### Return values

int —

Returns the number of blacklisted traits this instance has defined

#### hasBlacklistedTypes()

PHPSandbox.php : 4780

Query whether PHPSandbox instance has blacklisted types.

`public hasBlacklistedTypes() : int`

##### Return values

int —

Returns the number of blacklisted types this instance has defined

#### hasBlacklistedUses()

PHPSandbox.php : 4512

Query whether PHPSandbox instance has blacklisted uses (or aliases.)

`public hasBlacklistedUses() : int`

##### Tags

alias

  hasBlacklistedAliases();

##### Return values

int —

Returns the number of blacklisted uses (or aliases) this instance has defined

#### hasBlacklistedVars()

PHPSandbox.php : 4240

Query whether PHPSandbox instance has blacklisted variables.

`public hasBlacklistedVars() : int`

##### Return values

int —

Returns the number of blacklisted variables this instance has defined

#### hasDefinedAliases()

PHPSandbox.php : 3307

Query whether PHPSandbox instance has defined aliases

`public hasDefinedAliases() : int`

##### Return values

int —

Returns the number of aliases this instance has defined

#### hasDefinedClasses()

PHPSandbox.php : 3483

Query whether PHPSandbox instance has defined classes

`public hasDefinedClasses() : int`

##### Return values

int —

Returns the number of classes this instance has defined

#### hasDefinedConsts()

PHPSandbox.php : 3006

Query whether PHPSandbox instance has defined constants

`public hasDefinedConsts() : int`

##### Return values

int —

Returns the number of constants this instance has defined

#### hasDefinedFuncs()

PHPSandbox.php : 2705

Query whether PHPSandbox instance has defined functions

`public hasDefinedFuncs() : int`

##### Return values

int —

Returns the number of functions this instance has defined

#### hasDefinedInterfaces()

PHPSandbox.php : 3595

Query whether PHPSandbox instance has defined interfaces

`public hasDefinedInterfaces() : int`

##### Return values

int —

Returns the number of interfaces this instance has defined

#### hasDefinedMagicConsts()

PHPSandbox.php : 3099

Query whether PHPSandbox instance has defined magic constants

`public hasDefinedMagicConsts() : int`

##### Return values

int —

Returns the number of magic constants this instance has defined

#### hasDefinedNamespaces()

PHPSandbox.php : 3193

Query whether PHPSandbox instance has defined namespaces

`public hasDefinedNamespaces() : int`

##### Return values

int —

Returns the number of namespaces this instance has defined

#### hasDefinedSuperglobals()

PHPSandbox.php : 2902

Query whether PHPSandbox instance has defined superglobals, or if superglobal $name has defined keys

`public hasDefinedSuperglobals([string|null $name = null ]) : int`

##### Parameters

$name : string|null = null

  String of superglobal $name to check for keys

##### Return values

int —

Returns the number of superglobals or superglobal keys this instance has defined, or false if invalid superglobal name specified

#### hasDefinedTraits()

PHPSandbox.php : 3706

Query whether PHPSandbox instance has defined traits

`public hasDefinedTraits() : int`

##### Return values

int —

Returns the number of traits this instance has defined

#### hasDefinedUses()

PHPSandbox.php : 3399

Query whether PHPSandbox instance has defined uses (or aliases)

`public hasDefinedUses() : int`

##### Tags

alias

  hasDefinedAliases();

##### Return values

int —

Returns the number of uses (or aliases) this instance has defined

#### hasDefinedVars()

PHPSandbox.php : 2801

Query whether PHPSandbox instance has defined variables

`public hasDefinedVars() : int`

##### Return values

int —

Returns the number of variables this instance has defined

#### hasWhitelist()

PHPSandbox.php : 4154

Query whether PHPSandbox instance has whitelist type

`public hasWhitelist(string $type) : int`

##### Parameters

$type : string

  The whitelist type to query

##### Return values

int —

Returns the number of whitelists this instance has defined

#### hasWhitelistedAliases()

PHPSandbox.php : 4462

Query whether PHPSandbox instance has whitelisted aliases.

`public hasWhitelistedAliases() : int`

##### Return values

int —

Returns the number of whitelisted aliases this instance has defined

#### hasWhitelistedClasses()

PHPSandbox.php : 4544

Query whether PHPSandbox instance has whitelisted classes.

`public hasWhitelistedClasses() : int`

##### Return values

int —

Returns the number of whitelisted classes this instance has defined

#### hasWhitelistedConsts()

PHPSandbox.php : 4350

Query whether PHPSandbox instance has whitelisted constants.

`public hasWhitelistedConsts() : int`

##### Return values

int —

Returns the number of whitelisted constants this instance has defined

#### hasWhitelistedFuncs()

PHPSandbox.php : 4194

Query whether PHPSandbox instance has whitelisted functions.

`public hasWhitelistedFuncs() : int`

##### Return values

int —

Returns the number of whitelisted functions this instance has defined

#### hasWhitelistedGlobals()

PHPSandbox.php : 4268

Query whether PHPSandbox instance has whitelisted globals.

`public hasWhitelistedGlobals() : int`

##### Return values

int —

Returns the number of whitelisted globals this instance has defined

#### hasWhitelistedInterfaces()

PHPSandbox.php : 4582

Query whether PHPSandbox instance has whitelisted interfaces.

`public hasWhitelistedInterfaces() : int`

##### Return values

int —

Returns the number of whitelisted interfaces this instance has defined

#### hasWhitelistedMagicConsts()

PHPSandbox.php : 4386

Query whether PHPSandbox instance has whitelisted magic constants.

`public hasWhitelistedMagicConsts() : int`

##### Return values

int —

Returns the number of whitelisted magic constants this instance has defined

#### hasWhitelistedNamespaces()

PHPSandbox.php : 4424

Query whether PHPSandbox instance has whitelisted namespaces.

`public hasWhitelistedNamespaces() : int`

##### Return values

int —

Returns the number of whitelisted namespaces this instance has defined

#### hasWhitelistedOperators()

PHPSandbox.php : 4696

Query whether PHPSandbox instance has whitelisted operators.

`public hasWhitelistedOperators() : int`

##### Return values

int —

Returns the number of whitelisted operators this instance has defined

#### hasWhitelistedPrimitives()

PHPSandbox.php : 4734

Query whether PHPSandbox instance has whitelisted primitives.

`public hasWhitelistedPrimitives() : int`

##### Return values

int —

Returns the number of whitelisted primitives this instance has defined

#### hasWhitelistedSuperglobals()

PHPSandbox.php : 4306

Query whether PHPSandbox instance has whitelisted superglobals, or superglobal keys

`public hasWhitelistedSuperglobals([string|null $name = null ]) : int`

##### Parameters

$name : string|null = null

  The whitelist superglobal key to query

##### Return values

int —

Returns the number of whitelisted superglobals or superglobal keys this instance has defined

#### hasWhitelistedTraits()

PHPSandbox.php : 4620

Query whether PHPSandbox instance has whitelisted traits.

`public hasWhitelistedTraits() : int`

##### Return values

int —

Returns the number of whitelisted traits this instance has defined

#### hasWhitelistedTypes()

PHPSandbox.php : 4772

Query whether PHPSandbox instance has whitelisted types.

`public hasWhitelistedTypes() : int`

##### Return values

int —

Returns the number of whitelisted types this instance has defined

#### hasWhitelistedUses()

PHPSandbox.php : 4502

Query whether PHPSandbox instance has whitelisted uses (or aliases.)

`public hasWhitelistedUses() : int`

##### Tags

alias

  hasWhitelistedAliases();

##### Return values

int —

Returns the number of whitelisted uses (or aliases) this instance has defined

#### hasWhitelistedVars()

PHPSandbox.php : 4232

Query whether PHPSandbox instance has whitelisted variables.

`public hasWhitelistedVars() : int`

##### Return values

int —

Returns the number of whitelisted variables this instance has defined

#### hasWhitelistKeywords()

PHPSandbox.php : 4658

Query whether PHPSandbox instance has whitelisted keywords.

`public hasWhitelistKeywords() : int`

##### Return values

int —

Returns the number of whitelisted keywords this instance has defined

#### import()

PHPSandbox.php : 937

PHPSandbox __wakeup magic method

`public import(array<string|int, mixed>|string $template, int $import_flag) : PHPSandbox`

- Import JSON template into sandbox

##### Parameters

$template : array<string|int, mixed>|string

  The JSON array or string template to import

$import_flag : int

  Binary flags signifying which parts of the JSON template to import

##### Tags

throws
  Throwable

  Throws exception if JSON template could not be imported

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### importJSON()

PHPSandbox.php : 1047

Import JSON template into sandbox

`public importJSON(array<string|int, mixed>|string $template, int $import_flag) : PHPSandbox`

##### Parameters

$template : array<string|int, mixed>|string

  The JSON array or string template to import

$import_flag : int

  Binary flags signifying which parts of the JSON template to import

##### Tags

alias

  import();

throws
  Throwable

  Throws exception if JSON template could not be imported

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### is_blacklisted()

PHPSandbox.php : 0
`public is_blacklisted() :`

##### Return values

—

#### is_blacklisted_alias()

PHPSandbox.php : 0
`public is_blacklisted_alias() :`

##### Return values

—

#### is_blacklisted_class()

PHPSandbox.php : 0
`public is_blacklisted_class() :`

##### Return values

—

#### is_blacklisted_const()

PHPSandbox.php : 0
`public is_blacklisted_const() :`

##### Return values

—

#### is_blacklisted_func()

PHPSandbox.php : 0
`public is_blacklisted_func() :`

##### Return values

—

#### is_blacklisted_global()

PHPSandbox.php : 0
`public is_blacklisted_global() :`

##### Return values

—

#### is_blacklisted_interface()

PHPSandbox.php : 0
`public is_blacklisted_interface() :`

##### Return values

—

#### is_blacklisted_keyword()

PHPSandbox.php : 0
`public is_blacklisted_keyword() :`

##### Return values

—

#### is_blacklisted_magic_const()

PHPSandbox.php : 0
`public is_blacklisted_magic_const() :`

##### Return values

—

#### is_blacklisted_namespace()

PHPSandbox.php : 0
`public is_blacklisted_namespace() :`

##### Return values

—

#### is_blacklisted_operator()

PHPSandbox.php : 0
`public is_blacklisted_operator() :`

##### Return values

—

#### is_blacklisted_primitive()

PHPSandbox.php : 0
`public is_blacklisted_primitive() :`

##### Return values

—

#### is_blacklisted_superglobal()

PHPSandbox.php : 0
`public is_blacklisted_superglobal() :`

##### Return values

—

#### is_blacklisted_trait()

PHPSandbox.php : 0
`public is_blacklisted_trait() :`

##### Return values

—

#### is_blacklisted_type()

PHPSandbox.php : 0
`public is_blacklisted_type() :`

##### Return values

—

#### is_blacklisted_use()

PHPSandbox.php : 0
`public is_blacklisted_use() :`

##### Return values

—

#### is_blacklisted_var()

PHPSandbox.php : 0
`public is_blacklisted_var() :`

##### Return values

—

#### is_defined_alias()

PHPSandbox.php : 0
`public is_defined_alias() :`

##### Return values

—

#### is_defined_class()

PHPSandbox.php : 0
`public is_defined_class() :`

##### Return values

—

#### is_defined_const()

PHPSandbox.php : 0
`public is_defined_const() :`

##### Return values

—

#### is_defined_func()

PHPSandbox.php : 0
`public is_defined_func() :`

##### Return values

—

#### is_defined_interface()

PHPSandbox.php : 0
`public is_defined_interface() :`

##### Return values

—

#### is_defined_magic_const()

PHPSandbox.php : 0
`public is_defined_magic_const() :`

##### Return values

—

#### is_defined_namespace()

PHPSandbox.php : 0
`public is_defined_namespace() :`

##### Return values

—

#### is_defined_superglobal()

PHPSandbox.php : 0
`public is_defined_superglobal() :`

##### Return values

—

#### is_defined_trait()

PHPSandbox.php : 0
`public is_defined_trait() :`

##### Return values

—

#### is_defined_use()

PHPSandbox.php : 0
`public is_defined_use() :`

##### Return values

—

#### is_defined_var()

PHPSandbox.php : 0
`public is_defined_var() :`

##### Return values

—

#### is_whitelisted()

PHPSandbox.php : 0
`public is_whitelisted() :`

##### Return values

—

#### is_whitelisted_alias()

PHPSandbox.php : 0
`public is_whitelisted_alias() :`

##### Return values

—

#### is_whitelisted_class()

PHPSandbox.php : 0
`public is_whitelisted_class() :`

##### Return values

—

#### is_whitelisted_const()

PHPSandbox.php : 0
`public is_whitelisted_const() :`

##### Return values

—

#### is_whitelisted_func()

PHPSandbox.php : 0
`public is_whitelisted_func() :`

##### Return values

—

#### is_whitelisted_global()

PHPSandbox.php : 0
`public is_whitelisted_global() :`

##### Return values

—

#### is_whitelisted_interface()

PHPSandbox.php : 0
`public is_whitelisted_interface() :`

##### Return values

—

#### is_whitelisted_keyword()

PHPSandbox.php : 0
`public is_whitelisted_keyword() :`

##### Return values

—

#### is_whitelisted_magic_const()

PHPSandbox.php : 0
`public is_whitelisted_magic_const() :`

##### Return values

—

#### is_whitelisted_namespace()

PHPSandbox.php : 0
`public is_whitelisted_namespace() :`

##### Return values

—

#### is_whitelisted_operator()

PHPSandbox.php : 0
`public is_whitelisted_operator() :`

##### Return values

—

#### is_whitelisted_primitive()

PHPSandbox.php : 0
`public is_whitelisted_primitive() :`

##### Return values

—

#### is_whitelisted_superglobal()

PHPSandbox.php : 0
`public is_whitelisted_superglobal() :`

##### Return values

—

#### is_whitelisted_trait()

PHPSandbox.php : 0
`public is_whitelisted_trait() :`

##### Return values

—

#### is_whitelisted_type()

PHPSandbox.php : 0
`public is_whitelisted_type() :`

##### Return values

—

#### is_whitelisted_use()

PHPSandbox.php : 0
`public is_whitelisted_use() :`

##### Return values

—

#### is_whitelisted_var()

PHPSandbox.php : 0
`public is_whitelisted_var() :`

##### Return values

—

#### isBlacklisted()

PHPSandbox.php : 4186

Check if PHPSandbox instance has blacklist type and name set

`public isBlacklisted(string $type, string $name) : bool`

##### Parameters

$type : string

  String of blacklist $type to query

$name : string

  String of blacklist $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has blacklisted $type and $name, false otherwise

#### isBlacklistedAlias()

PHPSandbox.php : 4491

Check if PHPSandbox instance has blacklisted alias name set

`public isBlacklistedAlias(string $name) : bool`

##### Parameters

$name : string

  String of alias $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has blacklisted alias $name, false otherwise

#### isBlacklistedClass()

PHPSandbox.php : 4573

Check if PHPSandbox instance has blacklisted class name set

`public isBlacklistedClass(string $name) : bool`

##### Parameters

$name : string

  String of class $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has blacklisted class $name, false otherwise

#### isBlacklistedConst()

PHPSandbox.php : 4378

Check if PHPSandbox instance has blacklisted constant name set

`public isBlacklistedConst(string $name) : bool`

##### Parameters

$name : string

  String of constant $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has blacklisted constant $name, false otherwise

#### isBlacklistedFunc()

PHPSandbox.php : 4223

Check if PHPSandbox instance has blacklisted function name set

`public isBlacklistedFunc(string $name) : bool`

##### Parameters

$name : string

  String of function $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has blacklisted function $name, false otherwise

#### isBlacklistedGlobal()

PHPSandbox.php : 4296

Check if PHPSandbox instance has blacklisted global name set

`public isBlacklistedGlobal(string $name) : bool`

##### Parameters

$name : string

  String of global $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has blacklisted global $name, false otherwise

#### isBlacklistedInterface()

PHPSandbox.php : 4611

Check if PHPSandbox instance has blacklisted interface name set

`public isBlacklistedInterface(string $name) : bool`

##### Parameters

$name : string

  String of interface $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has blacklisted interface $name, false otherwise

#### isBlacklistedKeyword()

PHPSandbox.php : 4687

Check if PHPSandbox instance has blacklisted keyword name set

`public isBlacklistedKeyword(string $name) : bool`

##### Parameters

$name : string

  String of keyword $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has blacklisted keyword $name, false otherwise

#### isBlacklistedMagicConst()

PHPSandbox.php : 4415

Check if PHPSandbox instance has blacklisted magic constant name set

`public isBlacklistedMagicConst(string $name) : bool`

##### Parameters

$name : string

  String of magic constant $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has blacklisted magic constant $name, false otherwise

#### isBlacklistedNamespace()

PHPSandbox.php : 4453

Check if PHPSandbox instance has blacklisted namespace name set

`public isBlacklistedNamespace(string $name) : bool`

##### Parameters

$name : string

  String of namespace $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has blacklisted namespace $name, false otherwise

#### isBlacklistedOperator()

PHPSandbox.php : 4725

Check if PHPSandbox instance has blacklisted operator name set

`public isBlacklistedOperator(string $name) : bool`

##### Parameters

$name : string

  String of operator $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has blacklisted operator $name, false otherwise

#### isBlacklistedPrimitive()

PHPSandbox.php : 4763

Check if PHPSandbox instance has blacklisted primitive name set

`public isBlacklistedPrimitive(string $name) : bool`

##### Parameters

$name : string

  String of primitive $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has blacklisted primitive $name, false otherwise

#### isBlacklistedSuperglobal()

PHPSandbox.php : 4341

Check if PHPSandbox instance has blacklisted superglobal or superglobal key set

`public isBlacklistedSuperglobal(string $name[, string|null $key = null ]) : bool`

##### Parameters

$name : string

  String of blacklisted superglobal $name to query

$key : string|null = null

  String of blacklisted superglobal $key to query

##### Return values

bool —

Returns true if PHPSandbox instance has blacklisted superglobal key or superglobal, false otherwise

#### isBlacklistedTrait()

PHPSandbox.php : 4649

Check if PHPSandbox instance has blacklisted trait name set

`public isBlacklistedTrait(string $name) : bool`

##### Parameters

$name : string

  String of trait $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has blacklisted trait $name, false otherwise

#### isBlacklistedType()

PHPSandbox.php : 4801

Check if PHPSandbox instance has blacklisted type name set

`public isBlacklistedType(string $name) : bool`

##### Parameters

$name : string

  String of type $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has blacklisted type $name, false otherwise

#### isBlacklistedUse()

PHPSandbox.php : 4536

Check if PHPSandbox instance has blacklisted use (or alias) name set

`public isBlacklistedUse(string $name) : bool`

##### Parameters

$name : string

  String of use (or alias) $name to query

##### Tags

alias

  isBlacklistedAlias();

##### Return values

bool —

Returns true if PHPSandbox instance has blacklisted use (or alias) $name, false otherwise

#### isBlacklistedVar()

PHPSandbox.php : 4260

Check if PHPSandbox instance has blacklisted variable name set

`public isBlacklistedVar(string $name) : bool`

##### Parameters

$name : string

  String of variable $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has blacklisted variable $name, false otherwise

#### isDefinedAlias()

PHPSandbox.php : 3317

Check if PHPSandbox instance has $name alias defined

`public isDefinedAlias(string $name) : bool`

##### Parameters

$name : string

  String of alias $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has defined aliases, false otherwise

#### isDefinedClass()

PHPSandbox.php : 3492

Check if PHPSandbox instance has $name class defined

`public isDefinedClass(string $name) : bool`

##### Parameters

$name : string

  String of class $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has defined class, false otherwise

#### isDefinedConst()

PHPSandbox.php : 3016

Check if PHPSandbox instance has $name constant defined

`public isDefinedConst(string $name) : bool`

##### Parameters

$name : string

  String of constant $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has defined constant, false otherwise

#### isDefinedFunc()

PHPSandbox.php : 2715

Check if PHPSandbox instance has $name function defined

`public isDefinedFunc(string $name) : bool`

##### Parameters

$name : string

  String of function $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has defined function, false otherwise

#### isDefinedInterface()

PHPSandbox.php : 3605

Check if PHPSandbox instance has $name interface defined

`public isDefinedInterface(string $name) : bool`

##### Parameters

$name : string

  String of interface $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has defined interface, false otherwise

#### isDefinedMagicConst()

PHPSandbox.php : 3109

Check if PHPSandbox instance has $name magic constant defined

`public isDefinedMagicConst(string $name) : bool`

##### Parameters

$name : string

  String of magic constant $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has defined magic constant, false otherwise

#### isDefinedNamespace()

PHPSandbox.php : 3203

Check if PHPSandbox instance has $name namespace defined

`public isDefinedNamespace(string $name) : bool`

##### Parameters

$name : string

  String of namespace $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has defined namespace, false otherwise

#### isDefinedSuperglobal()

PHPSandbox.php : 2914

Check if PHPSandbox instance has $name superglobal defined, or if superglobal $name key is defined

`public isDefinedSuperglobal(string $name[, string|null $key = null ]) : bool`

##### Parameters

$name : string

  String of superglobal $name to query

$key : string|null = null

  String of key to to query in superglobal

##### Return values

bool —

Returns true if PHPSandbox instance has defined superglobal, false otherwise

#### isDefinedTrait()

PHPSandbox.php : 3716

Check if PHPSandbox instance has $name trait defined

`public isDefinedTrait(string $name) : bool`

##### Parameters

$name : string

  String of trait $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has defined trait, false otherwise

#### isDefinedUse()

PHPSandbox.php : 3411

Check if PHPSandbox instance has $name uses (or alias) defined

`public isDefinedUse(string $name) : bool`

##### Parameters

$name : string

  String of use (or alias) $name to query

##### Tags

alias

  isDefinedAlias();

##### Return values

bool —

Returns true if PHPSandbox instance has defined uses (or aliases) and false otherwise

#### isDefinedVar()

PHPSandbox.php : 2811

Check if PHPSandbox instance has $name variable defined

`public isDefinedVar(string $name) : bool`

##### Parameters

$name : string

  String of variable $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has defined variable, false otherwise

#### isWhitelisted()

PHPSandbox.php : 4175

Check if PHPSandbox instance has whitelist type and name set

`public isWhitelisted(string $type, string $name) : bool`

##### Parameters

$type : string

  String of whitelist $type to query

$name : string

  String of whitelist $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has whitelisted $type and $name, false otherwise

#### isWhitelistedAlias()

PHPSandbox.php : 4480

Check if PHPSandbox instance has whitelisted alias name set

`public isWhitelistedAlias(string $name) : bool`

##### Parameters

$name : string

  String of alias $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has whitelisted alias $name, false otherwise

#### isWhitelistedClass()

PHPSandbox.php : 4562

Check if PHPSandbox instance has whitelisted class name set

`public isWhitelistedClass(string $name) : bool`

##### Parameters

$name : string

  String of class $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has whitelisted class $name, false otherwise

#### isWhitelistedConst()

PHPSandbox.php : 4368

Check if PHPSandbox instance has whitelisted constant name set

`public isWhitelistedConst(string $name) : bool`

##### Parameters

$name : string

  String of constant $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has whitelisted constant $name, false otherwise

#### isWhitelistedFunc()

PHPSandbox.php : 4212

Check if PHPSandbox instance has whitelisted function name set

`public isWhitelistedFunc(string $name) : bool`

##### Parameters

$name : string

  String of function $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has whitelisted function $name, false otherwise

#### isWhitelistedGlobal()

PHPSandbox.php : 4286

Check if PHPSandbox instance has whitelisted global name set

`public isWhitelistedGlobal(string $name) : bool`

##### Parameters

$name : string

  String of global $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has whitelisted global $name, false otherwise

#### isWhitelistedInterface()

PHPSandbox.php : 4600

Check if PHPSandbox instance has whitelisted interface name set

`public isWhitelistedInterface(string $name) : bool`

##### Parameters

$name : string

  String of interface $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has whitelisted interface $name, false otherwise

#### isWhitelistedKeyword()

PHPSandbox.php : 4676

Check if PHPSandbox instance has whitelisted keyword name set

`public isWhitelistedKeyword(string $name) : bool`

##### Parameters

$name : string

  String of keyword $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has whitelisted keyword $name, false otherwise

#### isWhitelistedMagicConst()

PHPSandbox.php : 4404

Check if PHPSandbox instance has whitelisted magic constant name set

`public isWhitelistedMagicConst(string $name) : bool`

##### Parameters

$name : string

  String of magic constant $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has whitelisted magic constant $name, false otherwise

#### isWhitelistedNamespace()

PHPSandbox.php : 4442

Check if PHPSandbox instance has whitelisted namespace name set

`public isWhitelistedNamespace(string $name) : bool`

##### Parameters

$name : string

  String of namespace $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has whitelisted namespace $name, false otherwise

#### isWhitelistedOperator()

PHPSandbox.php : 4714

Check if PHPSandbox instance has whitelisted operator name set

`public isWhitelistedOperator(string $name) : bool`

##### Parameters

$name : string

  String of operator $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has whitelisted operator $name, false otherwise

#### isWhitelistedPrimitive()

PHPSandbox.php : 4752

Check if PHPSandbox instance has whitelisted primitive name set

`public isWhitelistedPrimitive(string $name) : bool`

##### Parameters

$name : string

  String of primitive $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has whitelisted primitive $name, false otherwise

#### isWhitelistedSuperglobal()

PHPSandbox.php : 4329

Check if PHPSandbox instance has whitelisted superglobal or superglobal key set

`public isWhitelistedSuperglobal(string $name[, string|null $key = null ]) : bool`

##### Parameters

$name : string

  String of whitelisted superglobal $name to query

$key : string|null = null

  String of whitelisted superglobal $key to query

##### Return values

bool —

Returns true if PHPSandbox instance has whitelisted superglobal key or superglobal, false otherwise

#### isWhitelistedTrait()

PHPSandbox.php : 4638

Check if PHPSandbox instance has whitelisted trait name set

`public isWhitelistedTrait(string $name) : bool`

##### Parameters

$name : string

  String of trait $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has whitelisted trait $name, false otherwise

#### isWhitelistedType()

PHPSandbox.php : 4790

Check if PHPSandbox instance has whitelisted type name set

`public isWhitelistedType(string $name) : bool`

##### Parameters

$name : string

  String of type $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has whitelisted type $name, false otherwise

#### isWhitelistedUse()

PHPSandbox.php : 4524

Check if PHPSandbox instance has whitelisted use (or alias) name set

`public isWhitelistedUse(string $name) : bool`

##### Parameters

$name : string

  String of use (or alias) $name to query

##### Tags

alias

  isWhitelistedAlias();

##### Return values

bool —

Returns true if PHPSandbox instance has whitelisted use (or alias) $name, false otherwise

#### isWhitelistedVar()

PHPSandbox.php : 4250

Check if PHPSandbox instance has whitelisted variable name set

`public isWhitelistedVar(string $name) : bool`

##### Parameters

$name : string

  String of variable $name to query

##### Return values

bool —

Returns true if PHPSandbox instance has whitelisted variable $name, false otherwise

#### normalize_alias()

PHPSandbox.php : 0
`public normalize_alias() :`

##### Return values

—

#### normalize_class()

PHPSandbox.php : 0
`public normalize_class() :`

##### Return values

—

#### normalize_func()

PHPSandbox.php : 0
`public normalize_func() :`

##### Return values

—

#### normalize_interface()

PHPSandbox.php : 0
`public normalize_interface() :`

##### Return values

—

#### normalize_keyword()

PHPSandbox.php : 0
`public normalize_keyword() :`

##### Return values

—

#### normalize_magic_const()

PHPSandbox.php : 0
`public normalize_magic_const() :`

##### Return values

—

#### normalize_namespace()

PHPSandbox.php : 0
`public normalize_namespace() :`

##### Return values

—

#### normalize_operator()

PHPSandbox.php : 0
`public normalize_operator() :`

##### Return values

—

#### normalize_primitive()

PHPSandbox.php : 0
`public normalize_primitive() :`

##### Return values

—

#### normalize_superglobal()

PHPSandbox.php : 0
`public normalize_superglobal() :`

##### Return values

—

#### normalize_trait()

PHPSandbox.php : 0
`public normalize_trait() :`

##### Return values

—

#### normalize_type()

PHPSandbox.php : 0
`public normalize_type() :`

##### Return values

—

#### normalize_use()

PHPSandbox.php : 0
`public normalize_use() :`

##### Return values

—

#### prepare()

PHPSandbox.php : 6920

Prepare passed callable for execution

`public prepare(callable $code[, bool $skip_validation = false ]) : string`

This function validates your code and automatically whitelists it according to your specified configuration

##### Parameters

$code : callable

  The callable to prepare for execution

$skip_validation : bool = false

  Boolean flag to indicate whether the sandbox should skip validation. Default is false.

##### Tags

throws
  Throwable

  Throws exception if error occurs in parsing, validation or whitelisting

##### Return values

string —

The generated code (this can also be accessed via $sandbox->generated_code)

#### prepare_aliases()

PHPSandbox.php : 0
`public prepare_aliases() :`

##### Return values

—

#### prepare_consts()

PHPSandbox.php : 0
`public prepare_consts() :`

##### Return values

—

#### prepare_namespaces()

PHPSandbox.php : 0
`public prepare_namespaces() :`

##### Return values

—

#### prepare_uses()

PHPSandbox.php : 0
`public prepare_uses() :`

##### Return values

—

#### prepare_vars()

PHPSandbox.php : 0
`public prepare_vars() :`

##### Return values

—

#### prepend()

PHPSandbox.php : 6698

Prepend trusted code

`public prepend(string|callable $code) : PHPSandbox`

##### Parameters

$code : string|callable

  String or callable of trusted $code to prepend to generated code

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### resetOptions()

PHPSandbox.php : 1159

Reset PHPSandbox options to their default values

`public resetOptions() : PHPSandbox`

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### set_error_handler()

PHPSandbox.php : 0
`public set_error_handler() :`

##### Return values

—

#### set_exception_handler()

PHPSandbox.php : 0
`public set_exception_handler() :`

##### Return values

—

#### set_validation_error_handler()

PHPSandbox.php : 0
`public set_validation_error_handler() :`

##### Return values

—

#### setAliasValidator()

PHPSandbox.php : 1505

Set validation callable for aliases

`public setAliasValidator(callable $callable) : PHPSandbox`

Validator callable must accept two parameters: a string of the normalized name of the checked element, and the PHPSandbox instance

##### Parameters

$callable : callable

  Callable that validates the passed alias name

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setAppendedCode()

PHPSandbox.php : 1796

Set PHPSandbox appended code

`public setAppendedCode([string $appended_code = '' ]) : PHPSandbox`

##### Parameters

$appended_code : string = ''

  Sets a string of the appended code

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setClassValidator()

PHPSandbox.php : 1571

Set validation callable for classes

`public setClassValidator(callable $callable) : PHPSandbox`

Validator callable must accept two parameters: a string of the normalized name of the checked element, and the PHPSandbox instance. NOTE: Normalized class names are lowercase

##### Parameters

$callable : callable

  Callable that validates the passed class name

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setCode()

PHPSandbox.php : 1864

Set PHPSandbox generated code

`public setCode([string $generated_code = '' ]) : PHPSandbox`

##### Parameters

$generated_code : string = ''

  Sets a string of the generated code

##### Tags

alias

  setGeneratedCode();

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setConstValidator()

PHPSandbox.php : 1412

Set validation callable for constants

`public setConstValidator(callable $callable) : PHPSandbox`

Validator callable must accept two parameters: a string of the normalized name of the checked element, and the PHPSandbox instance

##### Parameters

$callable : callable

  Callable that validates the passed constant name

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setErrorHandler()

PHPSandbox.php : 7020

Set callable to handle errors

`public setErrorHandler(callable $handler[, int $error_types = E_ALL ]) : PHPSandbox`

This function sets the sandbox error handler and the handled error types. The handler accepts the error number, the error message, the error file, the error line, the error context and the sandbox instance as arguments. If the error handler does not handle errors correctly then the sandbox's security may become compromised!

}, E_ALL); //ignore all errors, INSECURE

##### Parameters

$handler : callable

  Callable to handle thrown Errors

$error_types : int = E_ALL

  Integer flag of the error types to handle (default is E_ALL)

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setExceptionHandler()

PHPSandbox.php : 7086

Set callable to handle thrown exceptions

`public setExceptionHandler(callable|null $handler) : PHPSandbox`

This function sets the sandbox exception handler. The handler accepts the thrown exception and the sandbox instance as arguments. If the exception handler does not handle exceptions correctly then the sandbox's security may become compromised!

##### Parameters

$handler : callable|null

  Callable to handle thrown exceptions

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setExecutingFile()

PHPSandbox.php : 6827

Set the currently executing filepath

`public setExecutingFile(string|null $executing_file) : PHPSandbox`

##### Parameters

$executing_file : string|null

  The file currently being executed

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setFuncValidator()

PHPSandbox.php : 1288

Set validation callable for functions

`public setFuncValidator(callable $callable) : PHPSandbox`

Validator callable must accept two parameters: a string of the normalized name of the checked element, and the PHPSandbox instance. NOTE: Normalized function names include the namespace and are lowercase!

##### Parameters

$callable : callable

  Callable that validates the normalized passed function name

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setGeneratedCode()

PHPSandbox.php : 1851

Set PHPSandbox generated code

`public setGeneratedCode([string $generated_code = '' ]) : PHPSandbox`

##### Parameters

$generated_code : string = ''

  Sets a string of the generated code

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setGlobalValidator()

PHPSandbox.php : 1350

Set validation callable for globals

`public setGlobalValidator(callable $callable) : PHPSandbox`

Validator callable must accept two parameters: a string of the normalized name of the checked element, and the PHPSandbox instance

##### Parameters

$callable : callable

  Callable that validates the passed global name

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setInterfaceValidator()

PHPSandbox.php : 1602

Set validation callable for interfaces

`public setInterfaceValidator(callable $callable) : PHPSandbox`

Validator callable must accept two parameters: a string of the normalized name of the checked element, and the PHPSandbox instance. NOTE: Normalized interface names are lowercase

##### Parameters

$callable : callable

  Callable that validates the passed interface name

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setKeywordValidator()

PHPSandbox.php : 1664

Set validation callable for keywords

`public setKeywordValidator(callable $callable) : PHPSandbox`

Validator callable must accept two parameters: a string of the normalized name of the checked element, and the PHPSandbox instance

##### Parameters

$callable : callable

  Callable that validates the passed keyword name

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setMagicConstValidator()

PHPSandbox.php : 1443

Set validation callable for magic constants

`public setMagicConstValidator(callable $callable) : PHPSandbox`

Validator callable must accept two parameters: a string of the normalized name of the checked element, and the PHPSandbox instance. NOTE: Normalized magic constant names are upper case and trimmed of __

##### Parameters

$callable : callable

  Callable that validates the passed magic constant name

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setNamespaceValidator()

PHPSandbox.php : 1474

Set validation callable for namespaces

`public setNamespaceValidator(callable $callable) : PHPSandbox`

Validator callable must accept two parameters: a string of the normalized name of the checked element, and the PHPSandbox instance

##### Parameters

$callable : callable

  Callable that validates the passed namespace name

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setOperatorValidator()

PHPSandbox.php : 1695

Set validation callable for operators

`public setOperatorValidator(callable $callable) : PHPSandbox`

Validator callable must accept two parameters: a string of the normalized name of the checked element, and the PHPSandbox instance

##### Parameters

$callable : callable

  Callable that validates the passed operator name

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setOption()

PHPSandbox.php : 1067

Set PHPSandbox option

`public setOption(string|array<string|int, mixed> $option[, bool|int|null $value = null ]) : PHPSandbox`

You can pass an $option name to set to $value, an array of $option names to set to $value, or an associative array of $option names and their values to set.

##### Parameters

$option : string|array<string|int, mixed>

  String or array of strings or associative array of keys of option names to set $value to

$value : bool|int|null = null

  Boolean, integer or null $value to set $option to (optional)

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setOptions()

PHPSandbox.php : 1145

Set PHPSandbox options by array

`public setOptions(array<string|int, mixed>|string $options[, bool|int|null $value = null ]) : PHPSandbox`

You can pass an array of option names to set to $value, or an associative array of option names and their values to set.

##### Parameters

$options : array<string|int, mixed>|string

  Array of strings or associative array of keys of option names to set $value to, or JSON array or string template to import

$value : bool|int|null = null

  Boolean, integer or null $value to set $option to (optional)

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setParsedAST()

PHPSandbox.php : 1818

Set PHPSandbox parsed AST array

`public setParsedAST([array<string|int, mixed> $parsed_ast = [] ]) : PHPSandbox`

##### Parameters

$parsed_ast : array<string|int, mixed> = []

  Sets an array of the parsed AST code

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setPreparedAST()

PHPSandbox.php : 1840

Set PHPSandbox prepared AST array

`public setPreparedAST([array<string|int, mixed> $prepared_ast = [] ]) : PHPSandbox`

##### Parameters

$prepared_ast : array<string|int, mixed> = []

  Sets an array of the prepared AST code

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setPreparedCode()

PHPSandbox.php : 1829

Set PHPSandbox prepared code

`public setPreparedCode([string $prepared_code = '' ]) : PHPSandbox`

##### Parameters

$prepared_code : string = ''

  Sets a string of the prepared code

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setPreparsedCode()

PHPSandbox.php : 1807

Set PHPSandbox preparsed code

`public setPreparsedCode([string $preparsed_code = '' ]) : PHPSandbox`

##### Parameters

$preparsed_code : string = ''

  Sets a string of the preparsed code

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setPrependedCode()

PHPSandbox.php : 1785

Set PHPSandbox prepended code

`public setPrependedCode([string $prepended_code = '' ]) : PHPSandbox`

##### Parameters

$prepended_code : string = ''

  Sets a string of the prepended code

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setPrimitiveValidator()

PHPSandbox.php : 1726

Set validation callable for primitives

`public setPrimitiveValidator(callable $callable) : PHPSandbox`

Validator callable must accept two parameters: a string of the normalized name of the checked element, and the PHPSandbox instance

##### Parameters

$callable : callable

  Callable that validates the passed primitive name

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setSuperglobalValidator()

PHPSandbox.php : 1381

Set validation callable for superglobals

`public setSuperglobalValidator(callable $callable) : PHPSandbox`

Validator callable must accept two parameters: a string of the normalized name of the checked element, and the PHPSandbox instance. NOTE: Normalized superglobal names are uppercase and without a leading _

##### Parameters

$callable : callable

  Callable that validates the passed superglobal name

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setTraitValidator()

PHPSandbox.php : 1633

Set validation callable for traits

`public setTraitValidator(callable $callable) : PHPSandbox`

Validator callable must accept two parameters: a string of the normalized name of the checked element, and the PHPSandbox instance. NOTE: Normalized trait names are lowercase

##### Parameters

$callable : callable

  Callable that validates the passed trait name

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setTypeValidator()

PHPSandbox.php : 1757

Set validation callable for types

`public setTypeValidator(callable $callable) : PHPSandbox`

Validator callable must accept two parameters: a string of the normalized name of the checked element, and the PHPSandbox instance

##### Parameters

$callable : callable

  Callable that validates the passed type name

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setUseValidator()

PHPSandbox.php : 1538

Set validation callable for uses (aka aliases)

`public setUseValidator(callable $callable) : PHPSandbox`

Validator callable must accept two parameters: a string of the normalized name of the checked element, and the PHPSandbox instance

##### Parameters

$callable : callable

  Callable that validates the passed use (aka alias) name

##### Tags

alias

  setAliasValidator();

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setValidationErrorHandler()

PHPSandbox.php : 7145

Set callable to handle thrown validation Errors

`public setValidationErrorHandler(callable|null $handler) : PHPSandbox`

This function sets the sandbox validation Error handler. The handler accepts the thrown Error and the sandbox instance as arguments. If the error handler does not handle validation errors correctly then the sandbox's security may become compromised!

##### Parameters

$handler : callable|null

  Callable to handle thrown validation Errors

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setValidator()

PHPSandbox.php : 1247

Set validation callable for specified $type

`public setValidator(string $type, callable $callable) : PHPSandbox`

Validator callable must accept two parameters: a string of the normalized name of the checked element, and the PHPSandbox instance

##### Parameters

$type : string

  String of $type name to set validator for

$callable : callable

  Callable that validates the passed element

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### setVarValidator()

PHPSandbox.php : 1319

Set validation callable for variables

`public setVarValidator(callable $callable) : PHPSandbox`

Validator callable must accept two parameters: a string of the normalized name of the checked element, and the PHPSandbox instance

##### Parameters

$callable : callable

  Callable that validates the passed variable name

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### undefine()

PHPSandbox.php : 2604

Undefine PHPSandbox definitions, such as functions, constants, namespaces, etc.

`public undefine(string|array<string|int, mixed> $type[, string|array<string|int, mixed> $name = null ]) : PHPSandbox`

You can pass a string of the $type and $name to undefine, or pass an associative array of definitions types and an array of key names to undefine

##### Parameters

$type : string|array<string|int, mixed>

  Associative array or string of definition type to undefine

$name : string|array<string|int, mixed> = null

  Associative array or string of definition name to undefine

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### undefine_alias()

PHPSandbox.php : 0
`public undefine_alias() :`

##### Return values

—

#### undefine_aliases()

PHPSandbox.php : 0
`public undefine_aliases() :`

##### Return values

—

#### undefine_class()

PHPSandbox.php : 0
`public undefine_class() :`

##### Return values

—

#### undefine_classes()

PHPSandbox.php : 0
`public undefine_classes() :`

##### Return values

—

#### undefine_const()

PHPSandbox.php : 0
`public undefine_const() :`

##### Return values

—

#### undefine_consts()

PHPSandbox.php : 0
`public undefine_consts() :`

##### Return values

—

#### undefine_func()

PHPSandbox.php : 0
`public undefine_func() :`

##### Return values

—

#### undefine_funcs()

PHPSandbox.php : 0
`public undefine_funcs() :`

##### Return values

—

#### undefine_interface()

PHPSandbox.php : 0
`public undefine_interface() :`

##### Return values

—

#### undefine_interfaces()

PHPSandbox.php : 0
`public undefine_interfaces() :`

##### Return values

—

#### undefine_magic_const()

PHPSandbox.php : 0
`public undefine_magic_const() :`

##### Return values

—

#### undefine_magic_consts()

PHPSandbox.php : 0
`public undefine_magic_consts() :`

##### Return values

—

#### undefine_namespace()

PHPSandbox.php : 0
`public undefine_namespace() :`

##### Return values

—

#### undefine_namespaces()

PHPSandbox.php : 0
`public undefine_namespaces() :`

##### Return values

—

#### undefine_superglobal()

PHPSandbox.php : 0
`public undefine_superglobal() :`

##### Return values

—

#### undefine_superglobals()

PHPSandbox.php : 0
`public undefine_superglobals() :`

##### Return values

—

#### undefine_trait()

PHPSandbox.php : 0
`public undefine_trait() :`

##### Return values

—

#### undefine_traits()

PHPSandbox.php : 0
`public undefine_traits() :`

##### Return values

—

#### undefine_use()

PHPSandbox.php : 0
`public undefine_use() :`

##### Return values

—

#### undefine_uses()

PHPSandbox.php : 0
`public undefine_uses() :`

##### Return values

—

#### undefine_var()

PHPSandbox.php : 0
`public undefine_var() :`

##### Return values

—

#### undefine_vars()

PHPSandbox.php : 0
`public undefine_vars() :`

##### Return values

—

#### undefineAlias()

PHPSandbox.php : 3330

Undefine PHPSandbox alias

`public undefineAlias(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of alias $name to undefine, or an array of alias names to undefine

##### Parameters

$name : string|array<string|int, mixed>

  String of alias name, or array of alias names to undefine

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### undefineAliases()

PHPSandbox.php : 3349

Undefine PHPSandbox aliases by array

`public undefineAliases([array<string|int, mixed> $aliases = [] ]) : PHPSandbox`

You can pass an array of alias names to undefine, or an empty array or null argument to undefine all aliases

##### Parameters

$aliases : array<string|int, mixed> = []

  Array of alias names to undefine. Passing an empty array or no argument will result in undefining all aliases

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### undefineClass()

PHPSandbox.php : 3521

Undefine PHPSandbox class

`public undefineClass(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of class $name to undefine, or an array of class names to undefine

##### Parameters

$name : string|array<string|int, mixed>

  String of class name or an array of class names to undefine

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### undefineClasses()

PHPSandbox.php : 3540

Undefine PHPSandbox classes by array

`public undefineClasses([array<string|int, mixed> $classes = [] ]) : PHPSandbox`

You can pass an array of class names to undefine, or an empty array or null argument to undefine all classes

##### Parameters

$classes : array<string|int, mixed> = []

  Array of class names to undefine. Passing an empty array or no argument will result in undefining all classes

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### undefineConst()

PHPSandbox.php : 3028

Undefine PHPSandbox constant

`public undefineConst(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of constant $name to undefine, or an array of constant names to undefine

##### Parameters

$name : string|array<string|int, mixed>

  String of constant name or array of constant names to undefine

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### undefineConsts()

PHPSandbox.php : 3046

Undefine PHPSandbox constants by array

`public undefineConsts([array<string|int, mixed> $constants = [] ]) : PHPSandbox`

You can pass an array of constant names to undefine, or an empty array or null argument to undefine all constants

##### Parameters

$constants : array<string|int, mixed> = []

  Array of constant names to undefine. Passing an empty array or no argument will result in undefining all constants

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### undefineFunc()

PHPSandbox.php : 2728

Undefine PHPSandbox function

`public undefineFunc(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of function $name to undefine, or pass an array of function names to undefine

##### Parameters

$name : string|array<string|int, mixed>

  String of function name or array of function names to undefine

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### undefineFuncs()

PHPSandbox.php : 2747

Undefine PHPSandbox functions by array

`public undefineFuncs([array<string|int, mixed> $functions = [] ]) : PHPSandbox`

You can pass an array of function names to undefine, or an empty array or null argument to undefine all functions

##### Parameters

$functions : array<string|int, mixed> = []

  Array of function names to undefine. Passing an empty array or no argument will result in undefining all functions

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### undefineInterface()

PHPSandbox.php : 3634

Undefine PHPSandbox interface

`public undefineInterface(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of interface $name to undefine, or an array of interface names to undefine

##### Parameters

$name : string|array<string|int, mixed>

  String of interface name or an array of interface names to undefine

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### undefineInterfaces()

PHPSandbox.php : 3653

Undefine PHPSandbox interfaces by array

`public undefineInterfaces([array<string|int, mixed> $interfaces = [] ]) : PHPSandbox`

You can pass an array of interface names to undefine, or an empty array or null argument to undefine all interfaces

##### Parameters

$interfaces : array<string|int, mixed> = []

  Array of interface names to undefine. Passing an empty array or no argument will result in undefining all interfaces

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### undefineMagicConst()

PHPSandbox.php : 3122

Undefine PHPSandbox magic constant

`public undefineMagicConst(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass an a string of magic constant $name to undefine, or array of magic constant names to undefine

##### Parameters

$name : string|array<string|int, mixed>

  String of magic constant name, or array of magic constant names to undefine

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### undefineMagicConsts()

PHPSandbox.php : 3141

Undefine PHPSandbox magic constants by array

`public undefineMagicConsts([array<string|int, mixed> $magic_constants = [] ]) : PHPSandbox`

You can pass an array of magic constant names to undefine, or an empty array or null argument to undefine all magic constants

##### Parameters

$magic_constants : array<string|int, mixed> = []

  Array of magic constant names to undefine. Passing an empty array or no argument will result in undefining all magic constants

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### undefineNamespace()

PHPSandbox.php : 3232

Undefine PHPSandbox namespace

`public undefineNamespace(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of namespace $name to undefine, or an array of namespace names to undefine

##### Parameters

$name : string|array<string|int, mixed>

  String of namespace $name, or an array of namespace names to undefine

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### undefineNamespaces()

PHPSandbox.php : 3251

Undefine PHPSandbox namespaces by array

`public undefineNamespaces([array<string|int, mixed> $namespaces = [] ]) : PHPSandbox`

You can pass an array of namespace names to undefine, or an empty array or null argument to undefine all namespaces

##### Parameters

$namespaces : array<string|int, mixed> = []

  Array of namespace names to undefine. Passing an empty array or no argument will result in undefining all namespaces

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### undefineSuperglobal()

PHPSandbox.php : 2929

Undefine PHPSandbox superglobal or superglobal key

`public undefineSuperglobal(string|array<string|int, mixed> $name[, string|null $key = null ]) : PHPSandbox`

You can pass a string of superglobal $name to undefine, or a superglobal $key to undefine, or an array of superglobal names to undefine, or an an associative array of superglobal names and keys to undefine

##### Parameters

$name : string|array<string|int, mixed>

  String of superglobal $name, or array of superglobal names, or associative array of superglobal names and keys to undefine

$key : string|null = null

  String of superglobal $key to undefine

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### undefineSuperglobals()

PHPSandbox.php : 2953

Undefine PHPSandbox superglobals by array

`public undefineSuperglobals([array<string|int, mixed> $superglobals = [] ]) : PHPSandbox`

You can pass an array of superglobal names to undefine, or an associative array of superglobals names and key to undefine, or an empty array or null to undefine all superglobals

##### Parameters

$superglobals : array<string|int, mixed> = []

  Associative array of superglobal names and keys or array of superglobal names to undefine

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### undefineTrait()

PHPSandbox.php : 3745

Undefine PHPSandbox trait

`public undefineTrait(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of trait $name to undefine, or an array of trait names to undefine

##### Parameters

$name : string|array<string|int, mixed>

  String of trait name or an array of trait names to undefine

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### undefineTraits()

PHPSandbox.php : 3764

Undefine PHPSandbox traits by array

`public undefineTraits([array<string|int, mixed> $traits = [] ]) : PHPSandbox`

You can pass an array of trait names to undefine, or an empty array or null argument to undefine all traits

##### Parameters

$traits : array<string|int, mixed> = []

  Array of trait names to undefine. Passing an empty array or no argument will result in undefining all traits

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### undefineUse()

PHPSandbox.php : 3423

Undefine PHPSandbox use (or alias)

`public undefineUse(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of use (or alias) $name to undefine, or an array of use (or alias) names to undefine

##### Parameters

$name : string|array<string|int, mixed>

  String of use (or alias) name, or array of use (or alias) names to undefine

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### undefineUses()

PHPSandbox.php : 3437

Undefine PHPSandbox uses (or aliases) by array

`public undefineUses([array<string|int, mixed> $uses = [] ]) : PHPSandbox`

##### Parameters

$uses : array<string|int, mixed> = []

  Array of use (or alias) names to undefine. Passing an empty array or no argument will result in undefining all uses (or aliases)

##### Tags

alias

  undefineAliases();

  You can pass an array of use (or alias) names to undefine, or an empty array or null argument to undefine all uses (or aliases)

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### undefineVar()

PHPSandbox.php : 2823

Undefine PHPSandbox variable

`public undefineVar(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of variable $name to undefine, or an array of variable names to undefine

##### Parameters

$name : string|array<string|int, mixed>

  String of variable name or an array of variable names to undefine

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### undefineVars()

PHPSandbox.php : 2841

Undefine PHPSandbox variables by array

`public undefineVars([array<string|int, mixed> $variables = [] ]) : PHPSandbox`

You can pass an array of variable names to undefine, or an empty array or null argument to undefine all variables

##### Parameters

$variables : array<string|int, mixed> = []

  Array of variable names to undefine. Passing an empty array or no argument will result in undefining all variables

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### unset_error_handler()

PHPSandbox.php : 0
`public unset_error_handler() :`

##### Return values

—

#### unset_exception_handler()

PHPSandbox.php : 0
`public unset_exception_handler() :`

##### Return values

—

#### unset_validation_error_handler()

PHPSandbox.php : 0
`public unset_validation_error_handler() :`

##### Return values

—

#### unsetAliasValidator()

PHPSandbox.php : 1522

Unset validation callable for aliases

`public unsetAliasValidator() : PHPSandbox`

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### unsetClassValidator()

PHPSandbox.php : 1588

Unset validation callable for classes

`public unsetClassValidator() : PHPSandbox`

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### unsetConstValidator()

PHPSandbox.php : 1429

Unset validation callable for constants

`public unsetConstValidator() : PHPSandbox`

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### unsetErrorHandler()

PHPSandbox.php : 7042

Unset error handler

`public unsetErrorHandler() : self`

This function unsets the sandbox error handler.

##### Return values

self —

Returns the PHPSandbox instance for fluent querying

#### unsetExceptionHandler()

PHPSandbox.php : 7107

Unset exception handler

`public unsetExceptionHandler() : PHPSandbox`

This function unsets the sandbox exception handler.

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### unsetFuncValidator()

PHPSandbox.php : 1305

Unset validation callable for functions

`public unsetFuncValidator() : PHPSandbox`

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### unsetGlobalValidator()

PHPSandbox.php : 1367

Unset validation callable for globals

`public unsetGlobalValidator() : PHPSandbox`

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### unsetInterfaceValidator()

PHPSandbox.php : 1619

Unset validation callable for interfaces

`public unsetInterfaceValidator() : PHPSandbox`

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### unsetKeywordValidator()

PHPSandbox.php : 1681

Unset validation callable for keywords

`public unsetKeywordValidator() : PHPSandbox`

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### unsetMagicConstValidator()

PHPSandbox.php : 1460

Unset validation callable for magic constants

`public unsetMagicConstValidator() : PHPSandbox`

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### unsetNamespaceValidator()

PHPSandbox.php : 1491

Unset validation callable for namespaces

`public unsetNamespaceValidator() : PHPSandbox`

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### unsetOperatorValidator()

PHPSandbox.php : 1712

Unset validation callable for operators

`public unsetOperatorValidator() : PHPSandbox`

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### unsetPrimitiveValidator()

PHPSandbox.php : 1743

Unset validation callable for primitives

`public unsetPrimitiveValidator() : PHPSandbox`

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### unsetSuperglobalValidator()

PHPSandbox.php : 1398

Unset validation callable for superglobals

`public unsetSuperglobalValidator() : PHPSandbox`

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### unsetTraitValidator()

PHPSandbox.php : 1650

Unset validation callable for traits

`public unsetTraitValidator() : PHPSandbox`

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### unsetTypeValidator()

PHPSandbox.php : 1774

Unset validation callable for types

`public unsetTypeValidator() : PHPSandbox`

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### unsetUseValidator()

PHPSandbox.php : 1558

Unset validation callable for uses (aka aliases)

`public unsetUseValidator() : PHPSandbox`

##### Tags

alias

  unsetAliasValidator();

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### unsetValidationErrorHandler()

PHPSandbox.php : 7166

Unset validation error handler

`public unsetValidationErrorHandler() : PHPSandbox`

This function unsets the sandbox validation error handler.

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### unsetValidator()

PHPSandbox.php : 1271

Unset validation callable for specified $type

`public unsetValidator(string $type) : PHPSandbox`

##### Parameters

$type : string

  String of $type to unset

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### unsetVarValidator()

PHPSandbox.php : 1336

Unset validation callable for variables

`public unsetVarValidator() : PHPSandbox`

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### validate()

PHPSandbox.php : 6870

Validate passed callable for execution

`public validate(callable|string $code) : PHPSandbox`

##### Parameters

$code : callable|string

  The callable or string of code to validate

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### validation_error()

PHPSandbox.php : 0
`public validation_error() :`

##### Return values

—

#### validationError()

PHPSandbox.php : 7190

Invoke sandbox error validation handler if it exists, throw Error otherwise

`public validationError(Throwable|string $error, int $code[, Node|null $node = null ][, mixed $data = null ][, Throwable|null $previous = null ]) : mixed`

##### Parameters

$error : Throwable|string

  Exception to throw if exception is not handled, or error message string

$code : int

  The error code

$node : Node|null = null

  The error parser node

$data : mixed = null

  The error data

$previous : Throwable|null = null

  The previous exception thrown

##### Tags

throws
  Throwable

##### Return values

mixed —

#### whitelist()

PHPSandbox.php : 4033

Whitelist PHPSandbox definitions, such as functions, constants, classes, etc. to set

`public whitelist(string|array<string|int, mixed> $type[, string|array<string|int, mixed>|null $name = null ]) : PHPSandbox`

You can pass an associative array of whitelist types and their names, or a string $type and array of $names, or pass a string of the $type and $name

##### Parameters

$type : string|array<string|int, mixed>

  Associative array or string of whitelist type to set

$name : string|array<string|int, mixed>|null = null

  Array or string of whitelist name to set

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### whitelist_alias()

PHPSandbox.php : 0
`public whitelist_alias() :`

##### Return values

—

#### whitelist_class()

PHPSandbox.php : 0
`public whitelist_class() :`

##### Return values

—

#### whitelist_const()

PHPSandbox.php : 0
`public whitelist_const() :`

##### Return values

—

#### whitelist_func()

PHPSandbox.php : 0
`public whitelist_func() :`

##### Return values

—

#### whitelist_global()

PHPSandbox.php : 0
`public whitelist_global() :`

##### Return values

—

#### whitelist_interface()

PHPSandbox.php : 0
`public whitelist_interface() :`

##### Return values

—

#### whitelist_keyword()

PHPSandbox.php : 0
`public whitelist_keyword() :`

##### Return values

—

#### whitelist_magic_const()

PHPSandbox.php : 0
`public whitelist_magic_const() :`

##### Return values

—

#### whitelist_namespace()

PHPSandbox.php : 0
`public whitelist_namespace() :`

##### Return values

—

#### whitelist_operator()

PHPSandbox.php : 0
`public whitelist_operator() :`

##### Return values

—

#### whitelist_primitive()

PHPSandbox.php : 0
`public whitelist_primitive() :`

##### Return values

—

#### whitelist_superglobal()

PHPSandbox.php : 0
`public whitelist_superglobal() :`

##### Return values

—

#### whitelist_trait()

PHPSandbox.php : 0
`public whitelist_trait() :`

##### Return values

—

#### whitelist_type()

PHPSandbox.php : 0
`public whitelist_type() :`

##### Return values

—

#### whitelist_use()

PHPSandbox.php : 0
`public whitelist_use() :`

##### Return values

—

#### whitelist_var()

PHPSandbox.php : 0
`public whitelist_var() :`

##### Return values

—

#### whitelistAlias()

PHPSandbox.php : 5376

Whitelist alias

`public whitelistAlias(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of alias name, or pass an array of the alias names to whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of alias names or array of alias names to whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### whitelistClass()

PHPSandbox.php : 5508

Whitelist class

`public whitelistClass(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of class name, or pass an array of the class names to whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of class name or array of class names to whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### whitelistConst()

PHPSandbox.php : 5188

Whitelist constant

`public whitelistConst(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of constant name, or pass an array of the constant names to whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of constant name or array of constant names to whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### whitelistFunc()

PHPSandbox.php : 4814

Whitelist function

`public whitelistFunc(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of the function name, or pass an array of function names to whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of function name, or array of function names to whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### whitelistGlobal()

PHPSandbox.php : 4938

Whitelist global

`public whitelistGlobal(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of global name, or pass an array of the global names to whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of global name or array of global names to whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### whitelistInterface()

PHPSandbox.php : 5572

Whitelist interface

`public whitelistInterface(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of interface name, or pass an array of the interface names to whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of interface name or array of interface names to whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### whitelistKeyword()

PHPSandbox.php : 5700

Whitelist keyword

`public whitelistKeyword(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of keyword name, or pass an array of the keyword names to whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of keyword name or array of keyword names to whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### whitelistMagicConst()

PHPSandbox.php : 5248

Whitelist magic constant

`public whitelistMagicConst(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of magic constant name, or pass an array of the magic constant names to whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of magic constant name or array of magic constant names to whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### whitelistNamespace()

PHPSandbox.php : 5312

Whitelist namespace

`public whitelistNamespace(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of namespace name, or pass an array of the namespace names to whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of namespace name or array of namespace names to whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### whitelistOperator()

PHPSandbox.php : 5764

Whitelist operator

`public whitelistOperator(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of operator name, or pass an array of the operator names to whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of operator name or array of operator names to whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### whitelistPrimitive()

PHPSandbox.php : 5828

Whitelist primitive

`public whitelistPrimitive(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of primitive name, or pass an array of the primitive names to whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of primitive name or array of primitive names to whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### whitelistSuperglobal()

PHPSandbox.php : 5000

Whitelist superglobal or superglobal key

`public whitelistSuperglobal(string|array<string|int, mixed> $name[, string|null $key = null ]) : PHPSandbox`

You can pass a string of the superglobal name, or a string of the superglobal name and a string of the key, or pass an array of superglobal names, or an associative array of superglobal names and their keys to whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of superglobal name, or an array of superglobal names, or an associative array of superglobal names and their keys to whitelist

$key : string|null = null

  String of superglobal key to whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### whitelistTrait()

PHPSandbox.php : 5636

Whitelist trait

`public whitelistTrait(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of trait name, or pass an array of the trait names to whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of trait name or array of trait names to whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### whitelistType()

PHPSandbox.php : 5892

Whitelist type

`public whitelistType(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of type name, or pass an array of the type names to whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of type name or array of type names to whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### whitelistUse()

PHPSandbox.php : 5442

Whitelist use (or alias)

`public whitelistUse(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of use (or alias) name, or pass an array of the use (or alias) names to whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of use (or alias) name or array of use (or alias) names to whitelist

##### Tags

alias

  whitelistAlias();

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### whitelistVar()

PHPSandbox.php : 4878

Whitelist variable

`public whitelistVar(string|array<string|int, mixed> $name) : PHPSandbox`

You can pass a string of variable name, or pass an array of the variable names to whitelist

##### Parameters

$name : string|array<string|int, mixed>

  String of variable name or array of variable names to whitelist

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### autoDefine()

PHPSandbox.php : 6682

Automatically define variables passed to disassembled closure

`protected autoDefine(FunctionParser $disassembled_closure) : PHPSandbox`

##### Parameters

$disassembled_closure : FunctionParser

##### Return values

PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#### autoWhitelist()

PHPSandbox.php : 6662

Automatically whitelisted trusted code

`protected autoWhitelist(string $code[, bool $appended = false ]) : mixed`

##### Parameters

$code : string

  String of trusted $code to automatically whitelist

$appended : bool = false

  Flag if this code ir prended or appended (true = appended)

##### Tags

throws
  Throwable

  Throw exception if code cannot be parsed for whitelisting

##### Return values

mixed —

Return result of error handler if $code could not be parsed

#### disassemble()

PHPSandbox.php : 6642

Disassemble callable to string

`protected disassemble(callable $closure) : string`

##### Parameters

$closure : callable

  The callable to disassemble

##### Tags

throws
  Throwable

  Throw exception if callable is passed and FunctionParser library is missing

##### Return values

string —

Return the disassembled code string

#### normalizeAlias()

PHPSandbox.php : 3845

Normalize alias name. This is an internal PHPSandbox function.

`protected normalizeAlias(string|array<string|int, mixed> $name) : string|array<string|int, mixed>`

##### Parameters

$name : string|array<string|int, mixed>

  String of the alias $name, or array of strings to normalize

##### Return values

string|array<string|int, mixed> —

Returns the normalized alias string or an array of normalized strings

#### normalizeClass()

PHPSandbox.php : 3873

Normalize class name. This is an internal PHPSandbox function.

`protected normalizeClass(string|array<string|int, mixed> $name) : string|array<string|int, mixed>`

##### Parameters

$name : string|array<string|int, mixed>

  String of the class $name to normalize

##### Return values

string|array<string|int, mixed> —

Returns the normalized class string or an array of normalized strings

#### normalizeFunc()

PHPSandbox.php : 3781

Normalize function name. This is an internal PHPSandbox function.

`protected normalizeFunc(string|array<string|int, mixed> $name) : string|array<string|int, mixed>`

##### Parameters

$name : string|array<string|int, mixed>

  String of the function $name, or array of strings to normalize

##### Return values

string|array<string|int, mixed> —

Returns the normalized function string or an array of normalized strings

#### normalizeInterface()

PHPSandbox.php : 3889

Normalize interface name. This is an internal PHPSandbox function.

`protected normalizeInterface(string|array<string|int, mixed> $name) : string|array<string|int, mixed>`

##### Parameters

$name : string|array<string|int, mixed>

  String of the interface $name, or array of strings to normalize

##### Return values

string|array<string|int, mixed> —

Returns the normalized interface string or an array of normalized strings

#### normalizeKeyword()

PHPSandbox.php : 3921

Normalize keyword name. This is an internal PHPSandbox function.

`protected normalizeKeyword(string|array<string|int, mixed> $name) : string|array<string|int, mixed>`

##### Parameters

$name : string|array<string|int, mixed>

  String of the keyword $name, or array of strings to normalize

##### Return values

string|array<string|int, mixed> —

Returns the normalized keyword string or an array of normalized strings

#### normalizeMagicConst()

PHPSandbox.php : 3813

Normalize magic constant name. This is an internal PHPSandbox function.

`protected normalizeMagicConst(string|array<string|int, mixed> $name) : string|array<string|int, mixed>`

##### Parameters

$name : string|array<string|int, mixed>

  String of the magic constant $name, or array of strings to normalize

##### Return values

string|array<string|int, mixed> —

Returns the normalized magic constant string or an array of normalized strings

#### normalizeNamespace()

PHPSandbox.php : 3829

Normalize namespace name. This is an internal PHPSandbox function.

`protected normalizeNamespace(string|array<string|int, mixed> $name) : string|array<string|int, mixed>`

##### Parameters

$name : string|array<string|int, mixed>

  String of the namespace $name, or array of strings to normalize

##### Return values

string|array<string|int, mixed> —

Returns the normalized namespace string or an array of normalized strings

#### normalizeOperator()

PHPSandbox.php : 3966

Normalize operator name. This is an internal PHPSandbox function.

`protected normalizeOperator(string|array<string|int, mixed> $name) : string|array<string|int, mixed>`

##### Parameters

$name : string|array<string|int, mixed>

  String of the operator $name, or array of strings to normalize

##### Return values

string|array<string|int, mixed> —

Returns the normalized operator string or an array of normalized strings

#### normalizePrimitive()

PHPSandbox.php : 3992

Normalize primitive name. This is an internal PHPSandbox function.

`protected normalizePrimitive(string|array<string|int, mixed> $name) : string|array<string|int, mixed>`

##### Parameters

$name : string|array<string|int, mixed>

  String of the primitive $name, or array of strings to normalize

##### Return values

string|array<string|int, mixed> —

Returns the normalized primitive string or an array of normalized strings

#### normalizeSuperglobal()

PHPSandbox.php : 3797

Normalize superglobal name. This is an internal PHPSandbox function.

`protected normalizeSuperglobal(string|array<string|int, mixed> $name) : string|array<string|int, mixed>`

##### Parameters

$name : string|array<string|int, mixed>

  String of the superglobal $name, or array of strings to normalize

##### Return values

string|array<string|int, mixed> —

Returns the normalized superglobal string or an array of normalized strings

#### normalizeTrait()

PHPSandbox.php : 3905

Normalize trait name. This is an internal PHPSandbox function.

`protected normalizeTrait(string|array<string|int, mixed> $name) : string|array<string|int, mixed>`

##### Parameters

$name : string|array<string|int, mixed>

  String of the trait $name, or array of strings to normalize

##### Return values

string|array<string|int, mixed> —

Returns the normalized trait string or an array of normalized strings

#### normalizeType()

PHPSandbox.php : 4014

Normalize type name. This is an internal PHPSandbox function.

`protected normalizeType(string|array<string|int, mixed> $name) : string|array<string|int, mixed>`

##### Parameters

$name : string|array<string|int, mixed>

  String of the type $name, or array of strings to normalize

##### Return values

string|array<string|int, mixed> —

Returns the normalized type string or an array of normalized strings

#### normalizeUse()

PHPSandbox.php : 3863

Normalize use (or alias) name. This is an internal PHPSandbox function.

`protected normalizeUse(string|array<string|int, mixed> $name) : string|array<string|int, mixed>`

##### Parameters

$name : string|array<string|int, mixed>

  String of the use (or alias) $name, or array of strings to normalize

##### Tags

alias

  normalizeAlias();

##### Return values

string|array<string|int, mixed> —

Returns the normalized use (or alias) string or an array of normalized strings

#### prepareAliases()

PHPSandbox.php : 6611

Prepare defined aliases for execution

`protected prepareAliases() : string`

##### Tags

throws
  Throwable

  Throws exception if validation error occurs

##### Return values

string —

Prepared string of aliases (or uses) output

#### prepareConsts()

PHPSandbox.php : 6565

Prepare defined constants for execution

`protected prepareConsts() : string`

##### Tags

throws
  Throwable

  Throws exception if validation error occurs

##### Return values

string —

Prepared string of constants output

#### prepareNamespaces()

PHPSandbox.php : 6593

Prepare defined namespaces for execution

`protected prepareNamespaces() : string`

##### Tags

throws
  Throwable

  Throws exception if validation error occurs

##### Return values

string —

Prepared string of namespaces output

#### prepareUses()

PHPSandbox.php : 6630

Prepare defined uses (or aliases) for execution

`protected prepareUses() : string`

##### Tags

alias

  prepareAliases();

throws
  Throwable

  Throws exception if validation error occurs

##### Return values

string —

Prepared string of aliases (or uses) output

#### prepareVars()

PHPSandbox.php : 6534

Prepare defined variables for execution

`protected prepareVars() : string`

##### Tags

throws
  Throwable

  Throws exception if validation error occurs

##### Return values

string —

Prepared string of variable output

## Search results