# \PHPSandboxPHPSandbox

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

## Summary

Methods
Properties
Constants
__construct()
create()
__invoke()
__sleep()
import()
importJSON()
getName()
setOption()
setOptions()
resetOptions()
getOption()
setValidator()
getValidator()
unsetValidator()
setFuncValidator()
getFuncValidator()
unsetFuncValidator()
setVarValidator()
getVarValidator()
unsetVarValidator()
setGlobalValidator()
getGlobalValidator()
unsetGlobalValidator()
setSuperglobalValidator()
getSuperglobalValidator()
unsetSuperglobalValidator()
setConstValidator()
getConstValidator()
unsetConstValidator()
setMagicConstValidator()
getMagicConstValidator()
unsetMagicConstValidator()
setNamespaceValidator()
getNamespaceValidator()
unsetNamespaceValidator()
setAliasValidator()
getAliasValidator()
unsetAliasValidator()
setUseValidator()
getUseValidator()
unsetUseValidator()
setClassValidator()
getClassValidator()
unsetClassValidator()
setInterfaceValidator()
getInterfaceValidator()
unsetInterfaceValidator()
setTraitValidator()
getTraitValidator()
unsetTraitValidator()
setKeywordValidator()
getKeywordValidator()
unsetKeywordValidator()
setOperatorValidator()
getOperatorValidator()
unsetOperatorValidator()
setPrimitiveValidator()
getPrimitiveValidator()
unsetPrimitiveValidator()
setTypeValidator()
getTypeValidator()
unsetTypeValidator()
setPrependedCode()
setAppendedCode()
setPreparsedCode()
setParsedAST()
setPreparedCode()
setPreparedAST()
setGeneratedCode()
setCode()
getPrependedCode()
getAppendedCode()
getPreparsedCode()
getParsedAST()
getPreparedCode()
getPreparedAST()
getGeneratedCode()
getCode()
_get_defined_functions()
_get_defined_vars()
_get_superglobal()
_get_magic_const()
_get_defined_constants()
_get_declared_classes()
_get_declared_interfaces()
_get_declared_traits()
_func_get_args()
_func_get_arg()
_func_num_args()
_var_dump()
_print_r()
_var_export()
_intval()
_floatval()
_boolval()
_arrayval()
_objectval()
_is_string()
_is_object()
_is_scalar()
_is_callable()
_get_included_files()
_include()
_include_once()
_require()
_require_once()
call_func()
define()
undefine()
defineFunc()
defineFuncs()
hasDefinedFuncs()
isDefinedFunc()
undefineFunc()
undefineFuncs()
defineVar()
defineVars()
hasDefinedVars()
isDefinedVar()
undefineVar()
undefineVars()
defineSuperglobal()
defineSuperglobals()
hasDefinedSuperglobals()
isDefinedSuperglobal()
undefineSuperglobal()
undefineSuperglobals()
defineConst()
defineConsts()
hasDefinedConsts()
isDefinedConst()
undefineConst()
undefineConsts()
defineMagicConst()
defineMagicConsts()
hasDefinedMagicConsts()
isDefinedMagicConst()
undefineMagicConst()
undefineMagicConsts()
defineNamespace()
defineNamespaces()
hasDefinedNamespaces()
isDefinedNamespace()
getDefinedNamespace()
undefineNamespace()
undefineNamespaces()
defineAlias()
defineAliases()
hasDefinedAliases()
isDefinedAlias()
undefineAlias()
undefineAliases()
defineUse()
defineUses()
hasDefinedUses()
isDefinedUse()
undefineUse()
undefineUses()
defineClass()
defineClasses()
hasDefinedClasses()
isDefinedClass()
getDefinedClass()
undefineClass()
undefineClasses()
defineInterface()
defineInterfaces()
hasDefinedInterfaces()
isDefinedInterface()
getDefinedInterface()
undefineInterface()
undefineInterfaces()
defineTrait()
defineTraits()
hasDefinedTraits()
isDefinedTrait()
getDefinedTrait()
undefineTrait()
undefineTraits()
whitelist()
blacklist()
dewhitelist()
deblacklist()
hasWhitelist()
hasBlacklist()
isWhitelisted()
isBlacklisted()
hasWhitelistedFuncs()
hasBlacklistedFuncs()
isWhitelistedFunc()
isBlacklistedFunc()
hasWhitelistedVars()
hasBlacklistedVars()
isWhitelistedVar()
isBlacklistedVar()
hasWhitelistedGlobals()
hasBlacklistedGlobals()
isWhitelistedGlobal()
isBlacklistedGlobal()
hasWhitelistedSuperglobals()
hasBlacklistedSuperglobals()
isWhitelistedSuperglobal()
isBlacklistedSuperglobal()
hasWhitelistedConsts()
hasBlacklistedConsts()
isWhitelistedConst()
isBlacklistedConst()
hasWhitelistedMagicConsts()
hasBlacklistedMagicConsts()
isWhitelistedMagicConst()
isBlacklistedMagicConst()
hasWhitelistedNamespaces()
hasBlacklistedNamespaces()
isWhitelistedNamespace()
isBlacklistedNamespace()
hasWhitelistedAliases()
hasBlacklistedAliases()
isWhitelistedAlias()
isBlacklistedAlias()
hasWhitelistedUses()
hasBlacklistedUses()
isWhitelistedUse()
isBlacklistedUse()
hasWhitelistedClasses()
hasBlacklistedClasses()
isWhitelistedClass()
isBlacklistedClass()
hasWhitelistedInterfaces()
hasBlacklistedInterfaces()
isWhitelistedInterface()
isBlacklistedInterface()
hasWhitelistedTraits()
hasBlacklistedTraits()
isWhitelistedTrait()
isBlacklistedTrait()
hasWhitelistKeywords()
hasBlacklistedKeywords()
isWhitelistedKeyword()
isBlacklistedKeyword()
hasWhitelistedOperators()
hasBlacklistedOperators()
isWhitelistedOperator()
isBlacklistedOperator()
hasWhitelistedPrimitives()
hasBlacklistedPrimitives()
isWhitelistedPrimitive()
isBlacklistedPrimitive()
hasWhitelistedTypes()
hasBlacklistedTypes()
isWhitelistedType()
isBlacklistedType()
whitelistFunc()
blacklistFunc()
dewhitelistFunc()
deblacklistFunc()
whitelistVar()
blacklistVar()
dewhitelistVar()
deblacklistVar()
whitelistGlobal()
blacklistGlobal()
dewhitelistGlobal()
deblacklistGlobal()
whitelistSuperglobal()
blacklistSuperglobal()
dewhitelistSuperglobal()
deblacklistSuperglobal()
whitelistConst()
blacklistConst()
dewhitelistConst()
deblacklistConst()
whitelistMagicConst()
blacklistMagicConst()
dewhitelistMagicConst()
deblacklistMagicConst()
whitelistNamespace()
blacklistNamespace()
dewhitelistNamespace()
deblacklistNamespace()
whitelistAlias()
blacklistAlias()
dewhitelistAlias()
deblacklistAlias()
whitelistUse()
blacklistUse()
dewhitelistUse()
deblacklistUse()
whitelistClass()
blacklistClass()
dewhitelistClass()
deblacklistClass()
whitelistInterface()
blacklistInterface()
dewhitelistInterface()
deblacklistInterface()
whitelistTrait()
blacklistTrait()
dewhitelistTrait()
deblacklistTrait()
whitelistKeyword()
blacklistKeyword()
dewhitelistKeyword()
deblacklistKeyword()
whitelistOperator()
blacklistOperator()
dewhitelistOperator()
deblacklistOperator()
whitelistPrimitive()
blacklistPrimitive()
dewhitelistPrimitive()
deblacklistPrimitive()
whitelistType()
blacklistType()
dewhitelistType()
deblacklistType()
checkFunc()
checkVar()
checkGlobal()
checkSuperglobal()
checkConst()
checkMagicConst()
checkNamespace()
checkAlias()
checkUse()
checkClass()
checkInterface()
checkTrait()
checkKeyword()
checkOperator()
checkPrimitive()
checkType()
prepend()
append()
clear()
clearTrustedCode()
clearPrepended()
clearPrependedCode()
clearAppend()
clearAppendedCode()
clearCode()
getPreparedTime()
getExecutionTime()
getTime()
getMemoryUsage()
validate()
prepare()
execute()
setErrorHandler()
getErrorHandler()
unsetErrorHandler()
getLastError()
error()
setExceptionHandler()
getExceptionHandler()
unsetExceptionHandler()
getLastException()
exception()
setValidationErrorHandler()
getValidationErrorHandler()
unsetValidationErrorHandler()
getLastValidationError()
validationError()
getSandbox()
getIterator()
__call()
define_func()
define_funcs()
has_defined_funcs()
is_defined_func()
undefine_func()
undefine_funcs()
define_var()
define_vars()
has_defined_vars()
is_defined_var()
undefine_var()
undefine_vars()
define_superglobal()
define_superglobals()
has_defined_superglobals()
is_defined_superglobal()
undefine_superglobal()
undefine_superglobals()
define_const()
define_consts()
has_defined_consts()
is_defined_const()
undefine_const()
undefine_consts()
define_magic_const()
define_magic_consts()
has_defined_magic_consts()
is_defined_magic_const()
undefine_magic_const()
undefine_magic_consts()
define_namespace()
define_namespaces()
has_defined_namespaces()
is_defined_namespace()
get_defined_namespace()
undefine_namespace()
undefine_namespaces()
define_alias()
define_aliases()
has_defined_aliases()
is_defined_alias()
undefine_alias()
undefine_aliases()
define_use()
define_uses()
has_defined_uses()
is_defined_use()
undefine_use()
undefine_uses()
define_class()
define_classes()
has_defined_classes()
is_defined_class()
get_defined_class()
undefine_class()
undefine_classes()
define_interface()
define_interfaces()
has_defined_interfaces()
is_defined_interface()
get_defined_interface()
undefine_interface()
undefine_interfaces()
define_trait()
define_traits()
has_defined_traits()
is_defined_trait()
get_defined_trait()
undefine_trait()
undefine_traits()
has_whitelist()
has_blacklist()
is_whitelisted()
is_blacklisted()
has_whitelist_funcs()
has_blacklist_funcs()
is_whitelisted_func()
is_blacklisted_func()
has_whitelist_vars()
has_blacklist_vars()
is_whitelisted_var()
is_blacklisted_var()
has_whitelist_globals()
has_blacklist_globals()
is_whitelisted_global()
is_blacklisted_global()
has_whitelist_superglobals()
has_blacklist_superglobals()
is_whitelisted_superglobal()
is_blacklisted_superglobal()
has_whitelist_consts()
has_blacklist_consts()
is_whitelisted_const()
is_blacklisted_const()
has_whitelist_magic_consts()
has_blacklist_magic_consts()
is_whitelisted_magic_const()
is_blacklisted_magic_const()
has_whitelist_namespaces()
has_blacklist_namespaces()
is_whitelisted_namespace()
is_blacklisted_namespace()
has_whitelist_aliases()
has_blacklist_aliases()
is_whitelisted_alias()
is_blacklisted_alias()
has_whitelist_uses()
has_blacklist_uses()
is_whitelisted_use()
is_blacklisted_use()
has_whitelist_classes()
has_blacklist_classes()
is_whitelisted_class()
is_blacklisted_class()
has_whitelist_interfaces()
has_blacklist_interfaces()
is_whitelisted_interface()
is_blacklisted_interface()
has_whitelist_traits()
has_blacklist_traits()
is_whitelisted_trait()
is_blacklisted_trait()
has_whitelist_keywords()
has_blacklist_keywords()
is_whitelisted_keyword()
is_blacklisted_keyword()
has_whitelist_operators()
has_blacklist_operators()
is_whitelisted_operator()
is_blacklisted_operator()
has_whitelist_primitives()
has_blacklist_primitives()
is_whitelisted_primitive()
is_blacklisted_primitive()
has_whitelist_types()
has_blacklist_types()
is_whitelisted_type()
is_blacklisted_type()
whitelist_func()
blacklist_func()
dewhitelist_func()
deblacklist_func()
whitelist_var()
blacklist_var()
dewhitelist_var()
deblacklist_var()
whitelist_global()
blacklist_global()
dewhitelist_global()
deblacklist_global()
whitelist_superglobal()
blacklist_superglobal()
dewhitelist_superglobal()
deblacklist_superglobal()
whitelist_const()
blacklist_const()
dewhitelist_const()
deblacklist_const()
whitelist_magic_const()
blacklist_magic_const()
dewhitelist_magic_const()
deblacklist_magic_const()
whitelist_namespace()
blacklist_namespace()
dewhitelist_namespace()
deblacklist_namespace()
whitelist_alias()
blacklist_alias()
dewhitelist_alias()
deblacklist_alias()
whitelist_use()
blacklist_use()
dewhitelist_use()
deblacklist_use()
whitelist_class()
blacklist_class()
dewhitelist_class()
deblacklist_class()
whitelist_interface()
blacklist_interface()
dewhitelist_interface()
deblacklist_interface()
whitelist_trait()
blacklist_trait()
dewhitelist_trait()
deblacklist_trait()
whitelist_keyword()
blacklist_keyword()
dewhitelist_keyword()
deblacklist_keyword()
whitelist_operator()
blacklist_operator()
dewhitelist_operator()
deblacklist_operator()
whitelist_primitive()
blacklist_primitive()
dewhitelist_primitive()
deblacklist_primitive()
whitelist_type()
blacklist_type()
dewhitelist_type()
deblacklist_type()
check_func()
check_var()
check_global()
check_superglobal()
check_const()
check_magic_const()
check_namespace()
check_alias()
check_use()
check_class()
check_interface()
check_trait()
check_keyword()
check_operator()
check_primitive()
check_type()
clear_trusted_code()
clear_prepend()
clear_append()
clear_code()
get_prepared_time()
get_execution_time()
get_time()
set_error_handler()
get_error_handler()
unset_error_handler()
get_last_error()
set_exception_handler()
get_exception_handler()
unset_exception_handler()
get_last_exception()
set_validation_error_handler()
get_validation_error_handler()
unset_validation_error_handler()
get_last_validation_error()
validation_error()
normalize_func()
normalize_superglobal()
normalize_magic_const()
normalize_namespace()
normalize_alias()
normalize_use()
normalize_class()
normalize_interface()
normalize_trait()
normalize_keyword()
normalize_operator()
normalize_primitive()
normalize_type()
prepare_vars()
prepare_consts()
prepare_namespaces()
prepare_aliases()
prepare_uses()
auto_whitelist()
auto_define()
$superglobals
$magic_constants
$defined_funcs
$arg_funcs
$sandboxed_string_funcs
$name
$validate_functions
$validate_variables
$validate_globals
$validate_superglobals
$validate_constants
$validate_magic_constants
$validate_namespaces
$validate_aliases
$validate_classes
$validate_interfaces
$validate_traits
$validate_keywords
$validate_operators
$validate_primitives
$validate_types
$error_level
$time_limit
$allow_includes
$sandbox_includes
$restore_error_level
$convert_errors
$capture_output
$auto_whitelist_trusted_code
$auto_whitelist_functions
$auto_whitelist_constants
$auto_whitelist_globals
$auto_whitelist_classes
$auto_whitelist_interfaces
$auto_whitelist_traits
$auto_define_vars
$overwrite_defined_funcs
$overwrite_func_get_args
$overwrite_sandboxed_string_funcs
$overwrite_superglobals
$allow_functions
$allow_closures
$allow_variables
$allow_static_variables
$allow_objects
$allow_constants
$allow_globals
$allow_namespaces
$allow_aliases
$allow_classes
$allow_interfaces
$allow_traits
$allow_generators
$allow_escaping
$allow_casting
$allow_error_suppressing
$allow_references
$allow_backticks
$allow_halting
SANDBOX_PREFIX
IMPORT_ALL
IMPORT_OPTIONS
IMPORT_DEFINITIONS
IMPORT_WHITELIST
IMPORT_BLACKLIST
IMPORT_TRUSTED_CODE
IMPORT_CODE
normalizeFunc()
normalizeSuperglobal()
normalizeMagicConst()
normalizeNamespace()
normalizeAlias()
normalizeUse()
normalizeClass()
normalizeInterface()
normalizeTrait()
normalizeKeyword()
normalizeOperator()
normalizePrimitive()
normalizeType()
prepareVars()
prepareConsts()
prepareNamespaces()
prepareAliases()
prepareUses()
disassemble()
autoWhitelist()
autoDefine()
$definitions
$whitelist
$blacklist
$validation
$includes
$sandboxes
$prepended_code
$appended_code
$prepare_time
$execution_time
$memory_usage
$preparsed_code
$parsed_ast
$prepared_code
$prepared_ast
$generated_code
$error_handler
$error_handler_types
$last_error
$exception_handler
$last_exception
$validation_error_handler
$last_validation_error
N/A
No private methods found
No private properties found
N/A

File
  PHPSandbox.php
Package
  PHPSandbox
Class hierarchy
  \PHPSandbox\PHPSandbox
Implements

## Tags

namespace | PHPSandbox
author | Elijah Horton elijah@corveda.com
version |

## Constants

### SANDBOX_PREFIX

    SANDBOX_PREFIX

#

## Tags

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

### IMPORT_ALL

    IMPORT_ALL

#

## Tags

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

### IMPORT_OPTIONS

    IMPORT_OPTIONS

#

## Tags

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

### IMPORT_DEFINITIONS

    IMPORT_DEFINITIONS

#

## Tags

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

### IMPORT_WHITELIST

    IMPORT_WHITELIST

#

## Tags

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

### IMPORT_BLACKLIST

    IMPORT_BLACKLIST

#

## Tags

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

### IMPORT_TRUSTED_CODE

    IMPORT_TRUSTED_CODE

#

## Tags

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

### IMPORT_CODE

    IMPORT_CODE

#

## Tags

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

## Properties

### $superglobals

    $superglobals : array

#### Type

array — A static array of superglobal names used for redefining superglobal values

#

## Tags

static |

### $magic_constants

    $magic_constants : array

#### Type

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

#

## Tags

static |

### $defined_funcs

    $defined_funcs : array

#### Type

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

#

## Tags

static |

### $arg_funcs

    $arg_funcs : array

#### Type

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

#

## Tags

static |

### $sandboxed_string_funcs

    $sandboxed_string_funcs : array

#### Type

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

#

## Tags

static |

### $name

    $name : string

#### Type

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

#

## Tags

None found

### $validate_functions

    $validate_functions : boolean

#### Type

boolean — Flag to indicate whether the sandbox should validate functions

#

## Tags

default | true

### $validate_variables

    $validate_variables : boolean

#### Type

boolean — Flag to indicate whether the sandbox should validate variables

#

## Tags

default | true

### $validate_globals

    $validate_globals : boolean

#### Type

boolean — Flag to indicate whether the sandbox should validate globals

#

## Tags

default | true

### $validate_superglobals

    $validate_superglobals : boolean

#### Type

boolean — Flag to indicate whether the sandbox should validate superglobals

#

## Tags

default | true

### $validate_constants

    $validate_constants : boolean

#### Type

boolean — Flag to indicate whether the sandbox should validate constants

#

## Tags

default | true

### $validate_magic_constants

    $validate_magic_constants : boolean

#### Type

boolean — Flag to indicate whether the sandbox should validate magic constants

#

## Tags

default | true

### $validate_namespaces

    $validate_namespaces : boolean

#### Type

boolean — Flag to indicate whether the sandbox should validate namespaces

#

## Tags

default | true

### $validate_aliases

    $validate_aliases : boolean

#### Type

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

#

## Tags

default | true

### $validate_classes

    $validate_classes : boolean

#### Type

boolean — Flag to indicate whether the sandbox should validate classes

#

## Tags

default | true

### $validate_interfaces

    $validate_interfaces : boolean

#### Type

boolean — Flag to indicate whether the sandbox should validate interfaces

#

## Tags

default | true

### $validate_traits

    $validate_traits : boolean

#### Type

boolean — Flag to indicate whether the sandbox should validate traits

#

## Tags

default | true

### $validate_keywords

    $validate_keywords : boolean

#### Type

boolean — Flag to indicate whether the sandbox should validate keywords

#

## Tags

default | true

### $validate_operators

    $validate_operators : boolean

#### Type

boolean — Flag to indicate whether the sandbox should validate operators

#

## Tags

default | true

### $validate_primitives

    $validate_primitives : boolean

#### Type

boolean — Flag to indicate whether the sandbox should validate primitives

#

## Tags

default | true

### $validate_types

    $validate_types : boolean

#### Type

boolean — Flag to indicate whether the sandbox should validate types

#

## Tags

default | true

### $error_level

    $error_level : integer

#### Type

integer — 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

### $time_limit

    $time_limit : integer

#### Type

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

#

## Tags

default | 0

### $allow_includes

    $allow_includes : boolean

#### Type

boolean — Flag to indicate whether the sandbox should allow included files

#

## Tags

default | false

### $sandbox_includes

    $sandbox_includes : boolean

#### Type

boolean — Flag to indicate whether the sandbox should automatically sandbox included files

#

## Tags

default | true

### $restore_error_level

    $restore_error_level : boolean

#### Type

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

#

## Tags

default | true

### $convert_errors

    $convert_errors : boolean

#### Type

boolean — Flag to indicate whether the sandbox should convert errors to exceptions

#

## Tags

default | false

### $capture_output

    $capture_output : boolean

#### Type

boolean — Flag whether to return output via an output buffer

#

## Tags

default | false

### $auto_whitelist_trusted_code

    $auto_whitelist_trusted_code : boolean

#### Type

boolean — Should PHPSandbox automagically whitelist prepended and appended code?

#

## Tags

default | true

### $auto_whitelist_functions

    $auto_whitelist_functions : boolean

#### Type

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

#

## Tags

default | true

### $auto_whitelist_constants

    $auto_whitelist_constants : boolean

#### Type

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

#

## Tags

default | true

### $auto_whitelist_globals

    $auto_whitelist_globals : boolean

#### Type

boolean — 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_classes

    $auto_whitelist_classes : boolean

#### Type

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

#

## Tags

default | true

### $auto_whitelist_interfaces

    $auto_whitelist_interfaces : boolean

#### Type

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

#

## Tags

default | true

### $auto_whitelist_traits

    $auto_whitelist_traits : boolean

#### Type

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

#

## Tags

default | true

### $auto_define_vars

    $auto_define_vars : boolean

#### Type

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

#

## Tags

default | true

### $overwrite_defined_funcs

    $overwrite_defined_funcs : boolean

#### Type

boolean — Should PHPSandbox overwrite get_define_functions, get_defined_vars, get_defined_constants, get_declared_classes, get_declared_interfaces and get_declared_traits?

#

## Tags

default | true

### $overwrite_func_get_args

    $overwrite_func_get_args : boolean

#### Type

boolean — Should PHPSandbox overwrite func_get_args, func_get_arg and func_num_args?

#

## Tags

default | true

### $overwrite_sandboxed_string_funcs

    $overwrite_sandboxed_string_funcs : boolean

#### Type

boolean — Should PHPSandbox overwrite functions to help hide SandboxedStrings?

#

## Tags

default | true

### $overwrite_superglobals

    $overwrite_superglobals : boolean

#### Type

boolean — 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

### $allow_functions

    $allow_functions : boolean

#### Type

boolean — Should PHPSandbox allow sandboxed code to declare functions?

#

## Tags

default | false

### $allow_closures

    $allow_closures : boolean

#### Type

boolean — Should PHPSandbox allow sandboxed code to declare closures?

#

## Tags

default | false

### $allow_variables

    $allow_variables : boolean

#### Type

boolean — Should PHPSandbox allow sandboxed code to create variables?

#

## Tags

default | true

### $allow_static_variables

    $allow_static_variables : boolean

#### Type

boolean — Should PHPSandbox allow sandboxed code to create static variables?

#

## Tags

default | true

### $allow_objects

    $allow_objects : boolean

#### Type

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

#

## Tags

default | true

### $allow_constants

    $allow_constants : boolean

#### Type

boolean — Should PHPSandbox allow sandboxed code to define constants?

#

## Tags

default | false

### $allow_globals

    $allow_globals : boolean

#### Type

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

#

## Tags

default | false

### $allow_namespaces

    $allow_namespaces : boolean

#### Type

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

#

## Tags

default | false

### $allow_aliases

    $allow_aliases : boolean

#### Type

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

#

## Tags

default | false

### $allow_classes

    $allow_classes : boolean

#### Type

boolean — Should PHPSandbox allow sandboxed code to declare classes?

#

## Tags

default | false

### $allow_interfaces

    $allow_interfaces : boolean

#### Type

boolean — Should PHPSandbox allow sandboxed code to declare interfaces?

#

## Tags

default | false

### $allow_traits

    $allow_traits : boolean

#### Type

boolean — Should PHPSandbox allow sandboxed code to declare traits?

#

## Tags

default | false

### $allow_generators

    $allow_generators : boolean

#### Type

boolean — Should PHPSandbox allow sandboxed code to create generators?

#

## Tags

default | true

### $allow_escaping

    $allow_escaping : boolean

#### Type

boolean — Should PHPSandbox allow sandboxed code to escape to HTML?

#

## Tags

default | false

### $allow_casting

    $allow_casting : boolean

#### Type

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

#

## Tags

default | false

### $allow_error_suppressing

    $allow_error_suppressing : boolean

#### Type

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

#

## Tags

default | false

### $allow_references

    $allow_references : boolean

#### Type

boolean — Should PHPSandbox allow sandboxed code to assign references?

#

## Tags

default | true

### $allow_backticks

    $allow_backticks : boolean

#### Type

boolean — 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_halting

    $allow_halting : boolean

#### Type

boolean — Should PHPSandbox allow sandboxed code to halt the PHP compiler?

#

## Tags

default | false

### $definitions

    $definitions : array

#### Type

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

#

## Tags

None found

### $whitelist

    $whitelist : array

#### Type

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

#

## Tags

None found

### $blacklist

    $blacklist : array

#### Type

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

#

## Tags

None found

### $validation

    $validation : array

#### Type

array — Array of custom validation functions

#

## Tags

None found

### $includes

    $includes : array

#### Type

array — Array of sandboxed included files

#

## Tags

None found

### $sandboxes

    $sandboxes : array<mixed,\PHPSandbox\PHPSandbox>

#### Type

array<mixed,\PHPSandbox\PHPSandbox> — Array of PHPSandboxes

#

## Tags

None found

### $prepended_code

    $prepended_code : string

#### Type

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

#

## Tags

None found

### $appended_code

    $appended_code : string

#### Type

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

#

## Tags

None found

### $prepare_time

    $prepare_time : float

#### Type

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

#

## Tags

None found

### $execution_time

    $execution_time : float

#### Type

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

#

## Tags

None found

### $memory_usage

    $memory_usage : integer

#### Type

integer — Int of the number of bytes the sandbox allocates during execution

#

## Tags

None found

### $preparsed_code

    $preparsed_code : string

#### Type

string — String of preparsed code, for debugging and serialization purposes

#

## Tags

None found

### $parsed_ast

    $parsed_ast : array

#### Type

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

#

## Tags

None found

### $prepared_code

    $prepared_code : string

#### Type

string — String of prepared code, for debugging and serialization purposes

#

## Tags

None found

### $prepared_ast

    $prepared_ast : array

#### Type

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

#

## Tags

None found

### $generated_code

    $generated_code : string

#### Type

string — String of generated code, for debugging and serialization purposes

#

## Tags

None found

### $error_handler

    $error_handler : null|callable

#### Type

null|callable — Callable that handles any errors when set

#

## Tags

None found

### $error_handler_types

    $error_handler_types : integer

#### Type

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

#

## Tags

None found

### $last_error

    $last_error : array

#### Type

array — The last error thrown by the sandbox

#

## Tags

None found

### $exception_handler

    $exception_handler : null|callable

#### Type

null|callable — Callable that handles any thrown exceptions when set

#

## Tags

None found

### $last_exception

    $last_exception : \Exception

#### Type

\Exception — The last exception thrown by the sandbox

#

## Tags

None found

### $validation_error_handler

    $validation_error_handler : null|callable

#### Type

null|callable — Callable that handles any thrown validation errors when set

#

## Tags

None found

### $last_validation_error

    $last_validation_error : \Exception|\PHPSandbox\Error

#### Type

\Exception|\PHPSandbox\Error — The last validation error thrown by the sandbox

#

## Tags

None found

## Methods

### __construct()

    __construct(array  $options = array(), array  $functions = array(), array  $variables = array(), array  $constants = array(), array  $namespaces = array(), array  $aliases = array(), array  $superglobals = array(), array  $magic_constants = array(), array  $classes = array(), array  $interfaces = array(), array  $traits = array())

PHPSandbox class constructor

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

#### Parameters

array | $options | Optional array of options to set for the sandbox
array | $functions | Optional array of functions to define for the sandbox
array | $variables | Optional array of variables to define for the sandbox
array | $constants | Optional array of constants to define for the sandbox
array | $namespaces | Optional array of namespaces to define for the sandbox
array | $aliases | Optional array of aliases to define for the sandbox
array | $superglobals | Optional array of superglobals to define for the sandbox
array | $magic_constants | Optional array of magic constants to define for the sandbox
array | $classes | Optional array of classes to define for the sandbox
array | $interfaces | Optional array of interfaces to define for the sandbox
array | $traits | Optional array of traits to define for the sandbox

#

## Tags

None found

### create()

    create(array  $options = array(), array  $functions = array(), array  $variables = array(), array  $constants = array(), array  $namespaces = array(), array  $aliases = array(), array  $superglobals = array(), array  $magic_constants = array(), array  $classes = array(), array  $interfaces = array(), array  $traits = array()) : $this

PHPSandbox static factory method

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

#### Parameters

array | $options | Optional array of options to set for the sandbox
array | $functions | Optional array of functions to define for the sandbox
array | $variables | Optional array of variables to define for the sandbox
array | $constants | Optional array of constants to define for the sandbox
array | $namespaces | Optional array of namespaces to define for the sandbox
array | $aliases | Optional array of aliases to define for the sandbox
array | $superglobals | Optional array of superglobals to define for the sandbox
array | $magic_constants | Optional array of magic constants to define for the sandbox
array | $classes | Optional array of classes to define for the sandbox
array | $interfaces | Optional array of interfaces to define for the sandbox
array | $traits | Optional array of traits to define for the sandbox

#### Returns

$this —

The returned PHPSandbox variable

#

static

## Tags

None found

### __invoke()

    __invoke(\Closure|callable|string  $code) : mixed

PHPSandbox __invoke magic method

Besides the code or closure to be executed, you can also pass additional arguments that will overwrite the default values of their respective arguments defined in the code

#### Parameters

\Closure|callable|string | $code | The closure, callable or string of code to execute

#### Returns

mixed —

The output of the executed sandboxed code

#

## Tags

None found

### __sleep()

    __sleep() : array

PHPSandbox __sleep magic method

#### Returns

array —

An array of property keys to be serialized

#

## Tags

None found

### import()

    import(array|string  $template, integer  $import_flag) : $this

PHPSandbox __wakeup magic method

- Import JSON template into sandbox

#### Parameters

array|string | $template | The JSON array or string template to import
integer | $import_flag | Binary flags signifying which parts of the JSON template to import

#### Throws

\PHPSandbox\Error

  Throws exception if JSON template could not be imported

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### importJSON()

    importJSON(array|string  $template, integer  $import_flag) : $this

Import JSON template into sandbox

#### Parameters

array|string | $template | The JSON array or string template to import
integer | $import_flag | Binary flags signifying which parts of the JSON template to import

#### Throws

\PHPSandbox\Error

  Throws exception if JSON template could not be imported

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

alias | import();

### getName()

    getName() : string

Get name of PHPSandbox variable

#### Returns

string —

The name of the PHPSandbox variable

#

## Tags

None found

### setOption()

    setOption(string|array  $option, boolean|integer|null  $value = null) : $this

Set PHPSandbox option

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

string|array | $option | String or array of strings or associative array of keys of option names to set $value to
boolean|integer|null | $value | Boolean, integer or null $value to set $option to (optional)

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### setOptions()

    setOptions(array|string  $options, boolean|integer|null  $value = null) : $this

Set PHPSandbox options by array

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

array|string | $options | Array of strings or associative array of keys of option names to set $value to, or JSON array or string template to import
boolean|integer|null | $value | Boolean, integer or null $value to set $option to (optional)

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### resetOptions()

    resetOptions() : $this

Reset PHPSandbox options to their default values

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### getOption()

    getOption(string  $option) : boolean|integer|null

Get PHPSandbox option

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

#### Parameters

string | $option | String of $option name to get

#### Returns

boolean|integer|null —

Returns the value of the requested option

#

## Tags

None found

### setValidator()

    setValidator(string  $type, callable  $callable) : \PHPSandbox\PHPSandbox

Set validation callable for specified $type

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

#### Parameters

string | $type | String of $type name to set validator for
callable | $callable | Callable that validates the passed element

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### getValidator()

    getValidator(string  $type) : callable|null

Get validation callable for specified $type

#### Parameters

string | $type | String of $type to return

#### Returns

callable|null

#

## Tags

None found

### unsetValidator()

    unsetValidator(string  $type) : \PHPSandbox\PHPSandbox

Unset validation callable for specified $type

#### Parameters

string | $type | String of $type to unset

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### setFuncValidator()

    setFuncValidator(callable  $callable) : \PHPSandbox\PHPSandbox

Set validation callable for functions

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

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### getFuncValidator()

    getFuncValidator() : callable|null

Get validation for functions

#### Returns

callable|null

#

## Tags

None found

### unsetFuncValidator()

    unsetFuncValidator() : \PHPSandbox\PHPSandbox

Unset validation callable for functions

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### setVarValidator()

    setVarValidator(callable  $callable) : \PHPSandbox\PHPSandbox

Set validation callable for variables

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

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### getVarValidator()

    getVarValidator() : callable|null

Get validation callable for variables

#### Returns

callable|null

#

## Tags

None found

### unsetVarValidator()

    unsetVarValidator() : \PHPSandbox\PHPSandbox

Unset validation callable for variables

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### setGlobalValidator()

    setGlobalValidator(callable  $callable) : \PHPSandbox\PHPSandbox

Set validation callable for globals

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

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### getGlobalValidator()

    getGlobalValidator() : callable|null

Get validation callable for globals

#### Returns

callable|null

#

## Tags

None found

### unsetGlobalValidator()

    unsetGlobalValidator() : \PHPSandbox\PHPSandbox

Unset validation callable for globals

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### setSuperglobalValidator()

    setSuperglobalValidator(callable  $callable) : \PHPSandbox\PHPSandbox

Set validation callable for superglobals

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

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### getSuperglobalValidator()

    getSuperglobalValidator() : callable|null

Get validation callable for superglobals

#### Returns

callable|null

#

## Tags

None found

### unsetSuperglobalValidator()

    unsetSuperglobalValidator() : \PHPSandbox\PHPSandbox

Unset validation callable for superglobals

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### setConstValidator()

    setConstValidator(callable  $callable) : \PHPSandbox\PHPSandbox

Set validation callable for constants

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

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### getConstValidator()

    getConstValidator() : callable|null

Get validation callable for constants

#### Returns

callable|null

#

## Tags

None found

### unsetConstValidator()

    unsetConstValidator() : \PHPSandbox\PHPSandbox

Unset validation callable for constants

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### setMagicConstValidator()

    setMagicConstValidator(callable  $callable) : \PHPSandbox\PHPSandbox

Set validation callable for magic constants

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

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### getMagicConstValidator()

    getMagicConstValidator() : callable|null

Get validation callable for magic constants

#### Returns

callable|null

#

## Tags

None found

### unsetMagicConstValidator()

    unsetMagicConstValidator() : \PHPSandbox\PHPSandbox

Unset validation callable for magic constants

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### setNamespaceValidator()

    setNamespaceValidator(callable  $callable) : \PHPSandbox\PHPSandbox

Set validation callable for namespaces

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

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### getNamespaceValidator()

    getNamespaceValidator() : callable|null

Get validation callable for namespaces

#### Returns

callable|null

#

## Tags

None found

### unsetNamespaceValidator()

    unsetNamespaceValidator() : \PHPSandbox\PHPSandbox

Unset validation callable for namespaces

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### setAliasValidator()

    setAliasValidator(callable  $callable) : \PHPSandbox\PHPSandbox

Set validation callable for aliases

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

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### getAliasValidator()

    getAliasValidator() : callable|null

Get validation callable for aliases

#### Returns

callable|null

#

## Tags

None found

### unsetAliasValidator()

    unsetAliasValidator() : \PHPSandbox\PHPSandbox

Unset validation callable for aliases

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### setUseValidator()

    setUseValidator(callable  $callable) : \PHPSandbox\PHPSandbox

Set validation callable for uses (aka aliases)

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

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

alias | setAliasValidator();

### getUseValidator()

    getUseValidator() : callable|null

Get validation callable for uses (aka aliases)

#### Returns

callable|null

#

## Tags

alias | getAliasValidator();

### unsetUseValidator()

    unsetUseValidator() : \PHPSandbox\PHPSandbox

Unset validation callable for uses (aka aliases)

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

alias | unsetAliasValidator();

### setClassValidator()

    setClassValidator(callable  $callable) : \PHPSandbox\PHPSandbox

Set validation callable for classes

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

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### getClassValidator()

    getClassValidator() : callable|null

Get validation callable for classes

#### Returns

callable|null

#

## Tags

None found

### unsetClassValidator()

    unsetClassValidator() : \PHPSandbox\PHPSandbox

Unset validation callable for classes

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### setInterfaceValidator()

    setInterfaceValidator(callable  $callable) : \PHPSandbox\PHPSandbox

Set validation callable for interfaces

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

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### getInterfaceValidator()

    getInterfaceValidator() : callable|null

Get validation callable for interfaces

#### Returns

callable|null

#

## Tags

None found

### unsetInterfaceValidator()

    unsetInterfaceValidator() : \PHPSandbox\PHPSandbox

Unset validation callable for interfaces

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### setTraitValidator()

    setTraitValidator(callable  $callable) : \PHPSandbox\PHPSandbox

Set validation callable for traits

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

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### getTraitValidator()

    getTraitValidator() : callable|null

Get validation callable for traits

#### Returns

callable|null

#

## Tags

None found

### unsetTraitValidator()

    unsetTraitValidator() : \PHPSandbox\PHPSandbox

Unset validation callable for traits

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### setKeywordValidator()

    setKeywordValidator(callable  $callable) : \PHPSandbox\PHPSandbox

Set validation callable for keywords

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

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### getKeywordValidator()

    getKeywordValidator() : callable|null

Get validation callable for keywords

#### Returns

callable|null

#

## Tags

None found

### unsetKeywordValidator()

    unsetKeywordValidator() : \PHPSandbox\PHPSandbox

Unset validation callable for keywords

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### setOperatorValidator()

    setOperatorValidator(callable  $callable) : \PHPSandbox\PHPSandbox

Set validation callable for operators

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

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### getOperatorValidator()

    getOperatorValidator() : callable|null

Get validation callable for operators

#### Returns

callable|null

#

## Tags

None found

### unsetOperatorValidator()

    unsetOperatorValidator() : \PHPSandbox\PHPSandbox

Unset validation callable for operators

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### setPrimitiveValidator()

    setPrimitiveValidator(callable  $callable) : \PHPSandbox\PHPSandbox

Set validation callable for primitives

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

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### getPrimitiveValidator()

    getPrimitiveValidator() : callable|null

Get validation callable for primitives

#### Returns

callable|null

#

## Tags

None found

### unsetPrimitiveValidator()

    unsetPrimitiveValidator() : \PHPSandbox\PHPSandbox

Unset validation callable for primitives

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### setTypeValidator()

    setTypeValidator(callable  $callable) : \PHPSandbox\PHPSandbox

Set validation callable for types

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

#### Returns

\PHPSandbox\PHPSandbox —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### getTypeValidator()

    getTypeValidator() : callable|null

Get validation callable for types

#### Returns

callable|null

#

## Tags

None found

### unsetTypeValidator()

    unsetTypeValidator() : $this

Unset validation callable for types

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### setPrependedCode()

    setPrependedCode(string  $prepended_code = '') : $this

Set PHPSandbox prepended code

#### Parameters

string | $prepended_code | Sets a string of the prepended code

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### setAppendedCode()

    setAppendedCode(string  $appended_code = '') : $this

Set PHPSandbox appended code

#### Parameters

string | $appended_code | Sets a string of the appended code

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### setPreparsedCode()

    setPreparsedCode(string  $preparsed_code = '') : $this

Set PHPSandbox preparsed code

#### Parameters

string | $preparsed_code | Sets a string of the preparsed code

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### setParsedAST()

    setParsedAST(array  $parsed_ast = array()) : $this

Set PHPSandbox parsed AST array

#### Parameters

array | $parsed_ast | Sets an array of the parsed AST code

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### setPreparedCode()

    setPreparedCode(string  $prepared_code = '') : $this

Set PHPSandbox prepared code

#### Parameters

string | $prepared_code | Sets a string of the prepared code

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### setPreparedAST()

    setPreparedAST(array  $prepared_ast = array()) : $this

Set PHPSandbox prepared AST array

#### Parameters

array | $prepared_ast | Sets an array of the prepared AST code

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### setGeneratedCode()

    setGeneratedCode(string  $generated_code = '') : $this

Set PHPSandbox generated code

#### Parameters

string | $generated_code | Sets a string of the generated code

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### setCode()

    setCode(string  $generated_code = '') : $this

Set PHPSandbox generated code

#### Parameters

string | $generated_code | Sets a string of the generated code

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

alias | setGeneratedCode();

### getPrependedCode()

    getPrependedCode() : string

Get PHPSandbox prepended code

#### Returns

string —

Returns a string of the prepended code

#

## Tags

None found

### getAppendedCode()

    getAppendedCode() : string

Get PHPSandbox appended code

#### Returns

string —

Returns a string of the appended code

#

## Tags

None found

### getPreparsedCode()

    getPreparsedCode() : string

Get PHPSandbox preparsed code

#### Returns

string —

Returns a string of the preparsed code

#

## Tags

None found

### getParsedAST()

    getParsedAST() : array

Get PHPSandbox parsed AST array

#### Returns

array —

Returns an array of the parsed AST code

#

## Tags

None found

### getPreparedCode()

    getPreparedCode() : string

Get PHPSandbox prepared code

#### Returns

string —

Returns a string of the prepared code

#

## Tags

None found

### getPreparedAST()

    getPreparedAST() : array

Get PHPSandbox prepared AST array

#### Returns

array —

Returns an array of the prepared AST code

#

## Tags

None found

### getGeneratedCode()

    getGeneratedCode() : string

Get PHPSandbox generated code

#### Returns

string —

Returns a string of the generated code

#

## Tags

None found

### getCode()

    getCode() : string

Get PHPSandbox generated code

#### Returns

string —

Returns a string of the generated code

#

## Tags

alias | getGeneratedCode();

### _get_defined_functions()

    _get_defined_functions(array  $functions = array()) : array

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

#### Parameters

array | $functions | Array result from get_defined_functions() is passed here

#### Returns

array —

Returns the redefined functions array

#

## Tags

None found

### _get_defined_vars()

    _get_defined_vars(array  $variables = array()) : array

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

#### Parameters

array | $variables | Array result from get_defined_vars() is passed here

#### Returns

array —

Returns the redefined variables array

#

## Tags

None found

### _get_superglobal()

    _get_superglobal(string  $name) : array

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

#### Parameters

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

#### Returns

array —

Returns the redefined superglobal

#

## Tags

None found

### _get_magic_const()

    _get_magic_const(string  $name) : array

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

#### Parameters

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

#### Returns

array —

Returns the redefined magic constant

#

## Tags

None found

### _get_defined_constants()

    _get_defined_constants(array  $constants = array()) : array

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

#### Parameters

array | $constants | Array result from get_defined_constants() is passed here

#### Returns

array —

Returns the redefined constants

#

## Tags

None found

### _get_declared_classes()

    _get_declared_classes(array  $classes = array()) : array

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

#### Parameters

array | $classes | Array result from get_declared_classes() is passed here

#### Returns

array —

Returns the redefined classes

#

## Tags

None found

### _get_declared_interfaces()

    _get_declared_interfaces(array  $interfaces = array()) : array

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

#### Parameters

array | $interfaces | Array result from get_declared_interfaces() is passed here

#### Returns

array —

Returns the redefined interfaces

#

## Tags

None found

### _get_declared_traits()

    _get_declared_traits(array  $traits = array()) : array

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

#### Parameters

array | $traits | Array result from get_declared_traits() is passed here

#### Returns

array —

Returns the redefined traits

#

## Tags

None found

### _func_get_args()

    _func_get_args(array  $arguments = array()) : array

Get PHPSandbox redefined function arguments array

#### Parameters

array | $arguments | Array result from func_get_args() is passed here

#### Returns

array —

Returns the redefined arguments array

#

## Tags

None found

### _func_get_arg()

    _func_get_arg(array  $arguments = array(), integer  $index) : array

Get PHPSandbox redefined function argument

#### Parameters

array | $arguments | Array result from func_get_args() is passed here
integer | $index | Requested func_get_arg index is passed here

#### Returns

array —

Returns the redefined argument

#

## Tags

None found

### _func_num_args()

    _func_num_args(array  $arguments = array()) : integer

Get PHPSandbox redefined number of function arguments

#### Parameters

array | $arguments | Array result from func_get_args() is passed here

#### Returns

integer —

Returns the redefined number of function arguments

#

## Tags

None found

### _var_dump()

    _var_dump() : array

Get PHPSandbox redefined var_dump

#### Returns

array —

Returns the redefined var_dump

#

## Tags

None found

### _print_r()

    _print_r() : array

Get PHPSandbox redefined print_r

#### Returns

array —

Returns the redefined print_r

#

## Tags

None found

### _var_export()

    _var_export() : array

Get PHPSandbox redefined var_export

#### Returns

array —

Returns the redefined var_export

#

## Tags

None found

### _intval()

    _intval(mixed  $value) : integer

Return integer value of SandboxedString or mixed value

#### Parameters

mixed | $value | Value to return as integer

#### Returns

integer —

Returns the integer value

#

## Tags

None found

### _floatval()

    _floatval(mixed  $value) : float

Return float value of SandboxedString or mixed value

#### Parameters

mixed | $value | Value to return as float

#### Returns

float —

Returns the float value

#

## Tags

None found

### _boolval()

    _boolval(mixed  $value) : boolean

Return boolean value of SandboxedString or mixed value

#### Parameters

mixed | $value | Value to return as boolean

#### Returns

boolean —

Returns the boolean value

#

## Tags

None found

### _arrayval()

    _arrayval(mixed  $value) : array

Return array value of SandboxedString or mixed value

#### Parameters

mixed | $value | Value to return as array

#### Returns

array —

Returns the array value

#

## Tags

None found

### _objectval()

    _objectval(mixed  $value) : object

Return object value of SandboxedString or mixed value

#### Parameters

mixed | $value | Value to return as object

#### Returns

object —

Returns the object value

#

## Tags

None found

### _is_string()

    _is_string(mixed  $value) : boolean

Return is_string value of SandboxedString or mixed value

#### Parameters

mixed | $value | Value to check if is_string

#### Returns

boolean —

Returns the is_string value

#

## Tags

None found

### _is_object()

    _is_object(mixed  $value) : boolean

Return is_object value of SandboxedString or mixed value

#### Parameters

mixed | $value | Value to check if is_object

#### Returns

boolean —

Returns the is_object value

#

## Tags

None found

### _is_scalar()

    _is_scalar(mixed  $value) : boolean

Return is_scalar value of SandboxedString or mixed value

#### Parameters

mixed | $value | Value to check if is_scalar

#### Returns

boolean —

Returns the is_scalar value

#

## Tags

None found

### _is_callable()

    _is_callable(mixed  $value) : boolean

Return is_callable value of SandboxedString or mixed value

#### Parameters

mixed | $value | Value to check if is_callable

#### Returns

boolean —

Returns the is_callable value

#

## Tags

None found

### _get_included_files()

    _get_included_files() : array

Return get_included_files() and sandboxed included files

#### Returns

array —

Returns array of get_included_files() and sandboxed included files

#

## Tags

None found

### _include()

    _include(string  $file) : mixed

Sandbox included file

#### Parameters

string | $file | Included file to sandbox

#### Returns

mixed —

Returns value passed from included file

#

## Tags

None found

### _include_once()

    _include_once(string  $file) : mixed

Sandbox included once file

#### Parameters

string | $file | Included once file to sandbox

#### Returns

mixed —

Returns value passed from included once file

#

## Tags

None found

### _require()

    _require(string  $file) : mixed

Sandbox required file

#### Parameters

string | $file | Required file to sandbox

#### Returns

mixed —

Returns value passed from required file

#

## Tags

None found

### _require_once()

    _require_once(string  $file) : mixed

Sandbox required once file

#### Parameters

string | $file | Required once file to sandbox

#### Returns

mixed —

Returns value passed from required once file

#

## Tags

None found

### call_func()

    call_func() : mixed

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

#### Throws

\PHPSandbox\Error

  Will throw exception if invalid function requested

#### Returns

mixed —

Returns the redefined function result

#

## Tags

None found

### define()

    define(string|array  $type, string|array|null  $name = null, mixed|null  $value = null) : $this

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

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

string|array | $type | Associative array or string of definition type to define
string|array|null | $name | Associative array or string of definition name to define
mixed|null | $value | Value of definition to define

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### undefine()

    undefine(string|array  $type, string|array  $name = null) : $this

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

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

string|array | $type | Associative array or string of definition type to undefine
string|array | $name | Associative array or string of definition name to undefine

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### defineFunc()

    defineFunc(string|array  $name, callable  $function, boolean  $pass_sandbox = false) : $this

Define PHPSandbox function

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

string|array | $name | Associative array or string of function $name to define
callable | $function | Callable to define $function to
boolean | $pass_sandbox | Pass PHPSandbox instance to defined function when called? Default is false

#### Throws

\PHPSandbox\Error

  Throws exception if unnamed or uncallable $function is defined

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### defineFuncs()

    defineFuncs(array  $functions = array()) : $this

Define PHPSandbox functions by array

You can pass an associative array of functions to define

#### Parameters

array | $functions | Associative array of $functions to define

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### hasDefinedFuncs()

    hasDefinedFuncs() : integer

Query whether PHPSandbox instance has defined functions

#### Returns

integer —

Returns the number of functions this instance has defined

#

## Tags

None found

### isDefinedFunc()

    isDefinedFunc(string  $name) : boolean

Check if PHPSandbox instance has $name function defined

#### Parameters

string | $name | String of function $name to query

#### Returns

boolean —

Returns true if PHPSandbox instance has defined function, false otherwise

#

## Tags

None found

### undefineFunc()

    undefineFunc(string|array  $name) : $this

Undefine PHPSandbox function

You can pass a string of function $name to undefine, or pass an array of function names to undefine

#### Parameters

string|array | $name | String of function name or array of function names to undefine

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### undefineFuncs()

    undefineFuncs(array  $functions = array()) : $this

Undefine PHPSandbox functions by array

You can pass an array of function names to undefine, or an empty array or null argument to undefine all functions

#### Parameters

array | $functions | Array of function names to undefine. Passing an empty array or no argument will result in undefining all functions

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### defineVar()

    defineVar(string|array  $name, mixed  $value) : $this

Define PHPSandbox variable

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

#### Parameters

string|array | $name | String of variable $name or associative array to define
mixed | $value | Value to define variable to

#### Throws

\PHPSandbox\Error

  Throws exception if unnamed variable is defined

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### defineVars()

    defineVars(array  $variables = array()) : $this

Define PHPSandbox variables by array

You can pass an associative array of variables to define

#### Parameters

array | $variables | Associative array of $variables to define

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### hasDefinedVars()

    hasDefinedVars() : integer

Query whether PHPSandbox instance has defined variables

#### Returns

integer —

Returns the number of variables this instance has defined

#

## Tags

None found

### isDefinedVar()

    isDefinedVar(string  $name) : boolean

Check if PHPSandbox instance has $name variable defined

#### Parameters

string | $name | String of variable $name to query

#### Returns

boolean —

Returns true if PHPSandbox instance has defined variable, false otherwise

#

## Tags

None found

### undefineVar()

    undefineVar(string|array  $name) : $this

Undefine PHPSandbox variable

You can pass a string of variable $name to undefine, or an array of variable names to undefine

#### Parameters

string|array | $name | String of variable name or an array of variable names to undefine

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### undefineVars()

    undefineVars(array  $variables = array()) : $this

Undefine PHPSandbox variables by array

You can pass an array of variable names to undefine, or an empty array or null argument to undefine all variables

#### Parameters

array | $variables | Array of variable names to undefine. Passing an empty array or no argument will result in undefining all variables

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### defineSuperglobal()

    defineSuperglobal(string|array  $name, mixed  $value) : $this

Define PHPSandbox superglobal

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

string|array | $name | String of superglobal $name or associative array of superglobal names to define
mixed | $value | Value to define superglobal to, can be callable

#### Throws

\PHPSandbox\Error

  Throws exception if unnamed superglobal is defined

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### defineSuperglobals()

    defineSuperglobals(array  $superglobals = array()) : $this

Define PHPSandbox superglobals by array

You can pass an associative array of superglobals to define

#### Parameters

array | $superglobals | Associative array of $superglobals to define

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### hasDefinedSuperglobals()

    hasDefinedSuperglobals(string|null  $name = null) : integer|boolean

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

#### Parameters

string|null | $name | String of superglobal $name to check for keys

#### Returns

integer|boolean —

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

#

## Tags

None found

### isDefinedSuperglobal()

    isDefinedSuperglobal(string  $name, string|null  $key = null) : boolean

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

#### Parameters

string | $name | String of superglobal $name to query
string|null | $key | String of key to to query in superglobal

#### Returns

boolean —

Returns true if PHPSandbox instance has defined superglobal, false otherwise

#

## Tags

None found

### undefineSuperglobal()

    undefineSuperglobal(string|array  $name, string|null  $key = null) : $this

Undefine PHPSandbox superglobal or superglobal key

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

string|array | $name | String of superglobal $name, or array of superglobal names, or associative array of superglobal names and keys to undefine
string|null | $key | String of superglobal $key to undefine

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### undefineSuperglobals()

    undefineSuperglobals(array  $superglobals = array()) : $this

Undefine PHPSandbox superglobals by array

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

array | $superglobals | Associative array of superglobal names and keys or array of superglobal names to undefine

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### defineConst()

    defineConst(string|array  $name, mixed  $value) : $this

Define PHPSandbox constant

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

#### Parameters

string|array | $name | String of constant $name or associative array to define
mixed | $value | Value to define constant to

#### Throws

\PHPSandbox\Error

  Throws exception if unnamed constant is defined

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### defineConsts()

    defineConsts(array  $constants = array()) : $this

Define PHPSandbox constants by array

You can pass an associative array of constants to define

#### Parameters

array | $constants | Associative array of $constants to define

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### hasDefinedConsts()

    hasDefinedConsts() : integer

Query whether PHPSandbox instance has defined constants

#### Returns

integer —

Returns the number of constants this instance has defined

#

## Tags

None found

### isDefinedConst()

    isDefinedConst(string  $name) : boolean

Check if PHPSandbox instance has $name constant defined

#### Parameters

string | $name | String of constant $name to query

#### Returns

boolean —

Returns true if PHPSandbox instance has defined constant, false otherwise

#

## Tags

None found

### undefineConst()

    undefineConst(string|array  $name) : $this

Undefine PHPSandbox constant

You can pass a string of constant $name to undefine, or an array of constant names to undefine

#### Parameters

string|array | $name | String of constant name or array of constant names to undefine

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### undefineConsts()

    undefineConsts(array  $constants = array()) : $this

Undefine PHPSandbox constants by array

You can pass an array of constant names to undefine, or an empty array or null argument to undefine all constants

#### Parameters

array | $constants | Array of constant names to undefine. Passing an empty array or no argument will result in undefining all constants

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### defineMagicConst()

    defineMagicConst(string|array  $name, mixed  $value) : $this

Define PHPSandbox magic constant

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

#### Parameters

string|array | $name | String of magic constant $name or associative array to define
mixed | $value | Value to define magic constant to, can be callable

#### Throws

\PHPSandbox\Error

  Throws exception if unnamed magic constant is defined

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### defineMagicConsts()

    defineMagicConsts(array  $magic_constants = array()) : $this

Define PHPSandbox magic constants by array

You can pass an associative array of magic constants to define

#### Parameters

array | $magic_constants | Associative array of $magic_constants to define

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### hasDefinedMagicConsts()

    hasDefinedMagicConsts() : integer

Query whether PHPSandbox instance has defined magic constants

#### Returns

integer —

Returns the number of magic constants this instance has defined

#

## Tags

None found

### isDefinedMagicConst()

    isDefinedMagicConst(string  $name) : boolean

Check if PHPSandbox instance has $name magic constant defined

#### Parameters

string | $name | String of magic constant $name to query

#### Returns

boolean —

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

#

## Tags

None found

### undefineMagicConst()

    undefineMagicConst(string|array  $name) : $this

Undefine PHPSandbox magic constant

You can pass an a string of magic constant $name to undefine, or array of magic constant names to undefine

#### Parameters

string|array | $name | String of magic constant name, or array of magic constant names to undefine

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### undefineMagicConsts()

    undefineMagicConsts(array  $magic_constants = array()) : $this

Undefine PHPSandbox magic constants by array

You can pass an array of magic constant names to undefine, or an empty array or null argument to undefine all magic constants

#### Parameters

array | $magic_constants | Array of magic constant names to undefine. Passing an empty array or no argument will result in undefining all magic constants

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### defineNamespace()

    defineNamespace(string|array  $name) : $this

Define PHPSandbox namespace

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

#### Parameters

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

#### Throws

\PHPSandbox\Error

  Throws exception if unnamed namespace is defined

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### defineNamespaces()

    defineNamespaces(array  $namespaces = array()) : $this

Define PHPSandbox namespaces by array

You can pass an array of namespaces to define

#### Parameters

array | $namespaces | Array of $namespaces to define

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### hasDefinedNamespaces()

    hasDefinedNamespaces() : integer

Query whether PHPSandbox instance has defined namespaces

#### Returns

integer —

Returns the number of namespaces this instance has defined

#

## Tags

None found

### isDefinedNamespace()

    isDefinedNamespace(string  $name) : boolean

Check if PHPSandbox instance has $name namespace defined

#### Parameters

string | $name | String of namespace $name to query

#### Returns

boolean —

Returns true if PHPSandbox instance has defined namespace, false otherwise

#

## Tags

None found

### getDefinedNamespace()

    getDefinedNamespace(string  $name) : string

Get defined namespace of $name

#### Parameters

string | $name | String of namespace $name to get

#### Throws

\PHPSandbox\Error

  Throws an exception if an invalid namespace name is requested

#### Returns

string —

Returns string of defined namespace value

#

## Tags

None found

### undefineNamespace()

    undefineNamespace(string|array  $name) : $this

Undefine PHPSandbox namespace

You can pass a string of namespace $name to undefine, or an array of namespace names to undefine

#### Parameters

string|array | $name | String of namespace $name, or an array of namespace names to undefine

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### undefineNamespaces()

    undefineNamespaces(array  $namespaces = array()) : $this

Undefine PHPSandbox namespaces by array

You can pass an array of namespace names to undefine, or an empty array or null argument to undefine all namespaces

#### Parameters

array | $namespaces | Array of namespace names to undefine. Passing an empty array or no argument will result in undefining all namespaces

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### defineAlias()

    defineAlias(string|array  $name, string|null  $alias = null) : $this

Define PHPSandbox alias

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

string|array | $name | 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
string|null | $alias | String of $alias to use

#### Throws

\PHPSandbox\Error

  Throws exception if unnamed namespace is used

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### defineAliases()

    defineAliases(array  $aliases = array()) : $this

Define PHPSandbox aliases by array

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

#### Parameters

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

#### Throws

\PHPSandbox\Error

  Throws exception if unnamed namespace is used

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### hasDefinedAliases()

    hasDefinedAliases() : integer

Query whether PHPSandbox instance has defined aliases

#### Returns

integer —

Returns the number of aliases this instance has defined

#

## Tags

None found

### isDefinedAlias()

    isDefinedAlias(string  $name) : boolean

Check if PHPSandbox instance has $name alias defined

#### Parameters

string | $name | String of alias $name to query

#### Returns

boolean —

Returns true if PHPSandbox instance has defined aliases, false otherwise

#

## Tags

None found

### undefineAlias()

    undefineAlias(string|array  $name) : $this

Undefine PHPSandbox alias

You can pass a string of alias $name to undefine, or an array of alias names to undefine

#### Parameters

string|array | $name | String of alias name, or array of alias names to undefine

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### undefineAliases()

    undefineAliases(array  $aliases = array()) : $this

Undefine PHPSandbox aliases by array

You can pass an array of alias names to undefine, or an empty array or null argument to undefine all aliases

#### Parameters

array | $aliases | Array of alias names to undefine. Passing an empty array or no argument will result in undefining all aliases

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### defineUse()

    defineUse(string|array  $name, string|null  $alias = null) : $this

Define PHPSandbox use (or alias)

#### Parameters

string|array | $name | 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
string|null | $alias | String of $alias to use

#### Throws

\PHPSandbox\Error

  Throws exception if unnamed namespace is used

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## 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

### defineUses()

    defineUses(array  $uses = array()) : $this

Define PHPSandbox uses (or aliases) by array

#### Parameters

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

#### Throws

\PHPSandbox\Error

  Throws exception if unnamed namespace is used

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

alias | defineAliases(); You can pass an array of namespaces to use, or an associative array of namespaces to use and their aliases

### hasDefinedUses()

    hasDefinedUses() : integer

Query whether PHPSandbox instance has defined uses (or aliases)

#### Returns

integer —

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

#

## Tags

alias | hasDefinedAliases();

### isDefinedUse()

    isDefinedUse(string  $name) : boolean

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

#### Parameters

string | $name | String of use (or alias) $name to query

#### Returns

boolean —

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

#

## Tags

alias | isDefinedAlias();

### undefineUse()

    undefineUse(string|array  $name) : $this

Undefine PHPSandbox use (or alias)

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

#### Parameters

string|array | $name | String of use (or alias) name, or array of use (or alias) names to undefine

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### undefineUses()

    undefineUses(array  $uses = array()) : $this

Undefine PHPSandbox uses (or aliases) by array

#### Parameters

array | $uses | Array of use (or alias) names to undefine. Passing an empty array or no argument will result in undefining all uses (or aliases)

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## 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)

### defineClass()

    defineClass(string|array  $name, mixed  $value) : $this

Define PHPSandbox class

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

#### Parameters

string|array | $name | String of class $name or associative array to define
mixed | $value | Value to define class to

#### Throws

\PHPSandbox\Error

  Throws exception if unnamed class is defined

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### defineClasses()

    defineClasses(array  $classes = array()) : $this

Define PHPSandbox classes by array

You can pass an associative array of classes to define

#### Parameters

array | $classes | Associative array of $classes to define

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### hasDefinedClasses()

    hasDefinedClasses() : integer

Query whether PHPSandbox instance has defined classes

#### Returns

integer —

Returns the number of classes this instance has defined

#

## Tags

None found

### isDefinedClass()

    isDefinedClass(string  $name) : boolean

Check if PHPSandbox instance has $name class defined

#### Parameters

string | $name | String of class $name to query

#### Returns

boolean —

Returns true if PHPSandbox instance has defined class, false otherwise

#

## Tags

None found

### getDefinedClass()

    getDefinedClass(string  $name) : string

Get defined class of $name

#### Parameters

string | $name | String of class $name to get

#### Throws

\PHPSandbox\Error

  Throws an exception if an invalid class name is requested

#### Returns

string —

Returns string of defined class value

#

## Tags

None found

### undefineClass()

    undefineClass(string|array  $name) : $this

Undefine PHPSandbox class

You can pass a string of class $name to undefine, or an array of class names to undefine

#### Parameters

string|array | $name | String of class name or an array of class names to undefine

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### undefineClasses()

    undefineClasses(array  $classes = array()) : $this

Undefine PHPSandbox classes by array

You can pass an array of class names to undefine, or an empty array or null argument to undefine all classes

#### Parameters

array | $classes | Array of class names to undefine. Passing an empty array or no argument will result in undefining all classes

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### defineInterface()

    defineInterface(string|array  $name, mixed  $value) : $this

Define PHPSandbox interface

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

#### Parameters

string|array | $name | String of interface $name or associative array to define
mixed | $value | Value to define interface to

#### Throws

\PHPSandbox\Error

  Throws exception if unnamed interface is defined

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### defineInterfaces()

    defineInterfaces(array  $interfaces = array()) : $this

Define PHPSandbox interfaces by array

You can pass an associative array of interfaces to define

#### Parameters

array | $interfaces | Associative array of $interfaces to define

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### hasDefinedInterfaces()

    hasDefinedInterfaces() : integer

Query whether PHPSandbox instance has defined interfaces

#### Returns

integer —

Returns the number of interfaces this instance has defined

#

## Tags

None found

### isDefinedInterface()

    isDefinedInterface(string  $name) : boolean

Check if PHPSandbox instance has $name interface defined

#### Parameters

string | $name | String of interface $name to query

#### Returns

boolean —

Returns true if PHPSandbox instance has defined interface, false otherwise

#

## Tags

None found

### getDefinedInterface()

    getDefinedInterface(string  $name) : string

Get defined interface of $name

#### Parameters

string | $name | String of interface $name to get

#### Throws

\PHPSandbox\Error

  Throws an exception if an invalid interface name is requested

#### Returns

string —

Returns string of defined interface value

#

## Tags

None found

### undefineInterface()

    undefineInterface(string|array  $name) : $this

Undefine PHPSandbox interface

You can pass a string of interface $name to undefine, or an array of interface names to undefine

#### Parameters

string|array | $name | String of interface name or an array of interface names to undefine

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### undefineInterfaces()

    undefineInterfaces(array  $interfaces = array()) : $this

Undefine PHPSandbox interfaces by array

You can pass an array of interface names to undefine, or an empty array or null argument to undefine all interfaces

#### Parameters

array | $interfaces | Array of interface names to undefine. Passing an empty array or no argument will result in undefining all interfaces

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### defineTrait()

    defineTrait(string|array  $name, mixed  $value) : $this

Define PHPSandbox trait

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

#### Parameters

string|array | $name | String of trait $name or associative array to define
mixed | $value | Value to define trait to

#### Throws

\PHPSandbox\Error

  Throws exception if unnamed trait is defined

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### defineTraits()

    defineTraits(array  $traits = array()) : $this

Define PHPSandbox traits by array

You can pass an associative array of traits to define

#### Parameters

array | $traits | Associative array of $traits to define

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### hasDefinedTraits()

    hasDefinedTraits() : integer

Query whether PHPSandbox instance has defined traits

#### Returns

integer —

Returns the number of traits this instance has defined

#

## Tags

None found

### isDefinedTrait()

    isDefinedTrait(string  $name) : boolean

Check if PHPSandbox instance has $name trait defined

#### Parameters

string | $name | String of trait $name to query

#### Returns

boolean —

Returns true if PHPSandbox instance has defined trait, false otherwise

#

## Tags

None found

### getDefinedTrait()

    getDefinedTrait(string  $name) : string

Get defined trait of $name

#### Parameters

string | $name | String of trait $name to get

#### Throws

\PHPSandbox\Error

  Throws an exception if an invalid trait name is requested

#### Returns

string —

Returns string of defined trait value

#

## Tags

None found

### undefineTrait()

    undefineTrait(string|array  $name) : $this

Undefine PHPSandbox trait

You can pass a string of trait $name to undefine, or an array of trait names to undefine

#### Parameters

string|array | $name | String of trait name or an array of trait names to undefine

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### undefineTraits()

    undefineTraits(array  $traits = array()) : $this

Undefine PHPSandbox traits by array

You can pass an array of trait names to undefine, or an empty array or null argument to undefine all traits

#### Parameters

array | $traits | Array of trait names to undefine. Passing an empty array or no argument will result in undefining all traits

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### whitelist()

    whitelist(string|array  $type, string|array|null  $name = null) : $this

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

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

string|array | $type | Associative array or string of whitelist type to set
string|array|null | $name | Array or string of whitelist name to set

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### blacklist()

    blacklist(string|array  $type, string|array|null  $name = null) : $this

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

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

string|array | $type | Associative array or string of blacklist type to set
string|array|null | $name | Array or string of blacklist name to set

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### dewhitelist()

    dewhitelist(string|array  $type, string|array|null  $name) : $this

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

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

string|array | $type | Associative array or string of whitelist type to unset
string|array|null | $name | Array or string of whitelist name to unset

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### deblacklist()

    deblacklist(string|array  $type, string|array|null  $name) : $this

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

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

string|array | $type | Associative array or string of blacklist type to unset
string|array|null | $name | Array or string of blacklist name to unset

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### hasWhitelist()

    hasWhitelist(string  $type) : integer

Query whether PHPSandbox instance has whitelist type

#### Parameters

string | $type | The whitelist type to query

#### Returns

integer —

Returns the number of whitelists this instance has defined

#

## Tags

None found

### hasBlacklist()

    hasBlacklist(string  $type) : integer

Query whether PHPSandbox instance has blacklist type.

#### Parameters

string | $type | The blacklist type to query

#### Returns

integer —

Returns the number of blacklists this instance has defined

#

## Tags

None found

### isWhitelisted()

    isWhitelisted(string  $type, string  $name) : boolean

Check if PHPSandbox instance has whitelist type and name set

#### Parameters

string | $type | String of whitelist $type to query
string | $name | String of whitelist $name to query

#### Returns

boolean —

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

#

## Tags

None found

### isBlacklisted()

    isBlacklisted(string  $type, string  $name) : boolean

Check if PHPSandbox instance has blacklist type and name set

#### Parameters

string | $type | String of blacklist $type to query
string | $name | String of blacklist $name to query

#### Returns

boolean —

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

#

## Tags

None found

### hasWhitelistedFuncs()

    hasWhitelistedFuncs() : integer

Query whether PHPSandbox instance has whitelisted functions.

#### Returns

integer —

Returns the number of whitelisted functions this instance has defined

#

## Tags

None found

### hasBlacklistedFuncs()

    hasBlacklistedFuncs() : integer

Query whether PHPSandbox instance has blacklisted functions.

#### Returns

integer —

Returns the number of blacklisted functions this instance has defined

#

## Tags

None found

### isWhitelistedFunc()

    isWhitelistedFunc(string  $name) : boolean

Check if PHPSandbox instance has whitelisted function name set

#### Parameters

string | $name | String of function $name to query

#### Returns

boolean —

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

#

## Tags

None found

### isBlacklistedFunc()

    isBlacklistedFunc(string  $name) : boolean

Check if PHPSandbox instance has blacklisted function name set

#### Parameters

string | $name | String of function $name to query

#### Returns

boolean —

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

#

## Tags

None found

### hasWhitelistedVars()

    hasWhitelistedVars() : integer

Query whether PHPSandbox instance has whitelisted variables.

#### Returns

integer —

Returns the number of whitelisted variables this instance has defined

#

## Tags

None found

### hasBlacklistedVars()

    hasBlacklistedVars() : integer

Query whether PHPSandbox instance has blacklisted variables.

#### Returns

integer —

Returns the number of blacklisted variables this instance has defined

#

## Tags

None found

### isWhitelistedVar()

    isWhitelistedVar(string  $name) : boolean

Check if PHPSandbox instance has whitelisted variable name set

#### Parameters

string | $name | String of variable $name to query

#### Returns

boolean —

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

#

## Tags

None found

### isBlacklistedVar()

    isBlacklistedVar(string  $name) : boolean

Check if PHPSandbox instance has blacklisted variable name set

#### Parameters

string | $name | String of variable $name to query

#### Returns

boolean —

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

#

## Tags

None found

### hasWhitelistedGlobals()

    hasWhitelistedGlobals() : integer

Query whether PHPSandbox instance has whitelisted globals.

#### Returns

integer —

Returns the number of whitelisted globals this instance has defined

#

## Tags

None found

### hasBlacklistedGlobals()

    hasBlacklistedGlobals() : integer

Query whether PHPSandbox instance has blacklisted globals.

#### Returns

integer —

Returns the number of blacklisted globals this instance has defined

#

## Tags

None found

### isWhitelistedGlobal()

    isWhitelistedGlobal(string  $name) : boolean

Check if PHPSandbox instance has whitelisted global name set

#### Parameters

string | $name | String of global $name to query

#### Returns

boolean —

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

#

## Tags

None found

### isBlacklistedGlobal()

    isBlacklistedGlobal(string  $name) : boolean

Check if PHPSandbox instance has blacklisted global name set

#### Parameters

string | $name | String of global $name to query

#### Returns

boolean —

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

#

## Tags

None found

### hasWhitelistedSuperglobals()

    hasWhitelistedSuperglobals(string  $name = null) : integer

Query whether PHPSandbox instance has whitelisted superglobals, or superglobal keys

#### Parameters

string | $name | The whitelist superglobal key to query

#### Returns

integer —

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

#

## Tags

None found

### hasBlacklistedSuperglobals()

    hasBlacklistedSuperglobals(string  $name = null) : integer

Query whether PHPSandbox instance has blacklisted superglobals, or superglobal keys

#### Parameters

string | $name | The blacklist superglobal key to query

#### Returns

integer —

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

#

## Tags

None found

### isWhitelistedSuperglobal()

    isWhitelistedSuperglobal(string  $name, string  $key = null) : boolean

Check if PHPSandbox instance has whitelisted superglobal or superglobal key set

#### Parameters

string | $name | String of whitelisted superglobal $name to query
string | $key | String of whitelisted superglobal $key to query

#### Returns

boolean —

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

#

## Tags

None found

### isBlacklistedSuperglobal()

    isBlacklistedSuperglobal(string  $name, string  $key = null) : boolean

Check if PHPSandbox instance has blacklisted superglobal or superglobal key set

#### Parameters

string | $name | String of blacklisted superglobal $name to query
string | $key | String of blacklisted superglobal $key to query

#### Returns

boolean —

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

#

## Tags

None found

### hasWhitelistedConsts()

    hasWhitelistedConsts() : integer

Query whether PHPSandbox instance has whitelisted constants.

#### Returns

integer —

Returns the number of whitelisted constants this instance has defined

#

## Tags

None found

### hasBlacklistedConsts()

    hasBlacklistedConsts() : integer

Query whether PHPSandbox instance has blacklisted constants.

#### Returns

integer —

Returns the number of blacklisted constants this instance has defined

#

## Tags

None found

### isWhitelistedConst()

    isWhitelistedConst(string  $name) : boolean

Check if PHPSandbox instance has whitelisted constant name set

#### Parameters

string | $name | String of constant $name to query

#### Returns

boolean —

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

#

## Tags

None found

### isBlacklistedConst()

    isBlacklistedConst(string  $name) : boolean

Check if PHPSandbox instance has blacklisted constant name set

#### Parameters

string | $name | String of constant $name to query

#### Returns

boolean —

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

#

## Tags

None found

### hasWhitelistedMagicConsts()

    hasWhitelistedMagicConsts() : integer

Query whether PHPSandbox instance has whitelisted magic constants.

#### Returns

integer —

Returns the number of whitelisted magic constants this instance has defined

#

## Tags

None found

### hasBlacklistedMagicConsts()

    hasBlacklistedMagicConsts() : integer

Query whether PHPSandbox instance has blacklisted magic constants.

#### Returns

integer —

Returns the number of blacklisted magic constants this instance has defined

#

## Tags

None found

### isWhitelistedMagicConst()

    isWhitelistedMagicConst(string  $name) : boolean

Check if PHPSandbox instance has whitelisted magic constant name set

#### Parameters

string | $name | String of magic constant $name to query

#### Returns

boolean —

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

#

## Tags

None found

### isBlacklistedMagicConst()

    isBlacklistedMagicConst(string  $name) : boolean

Check if PHPSandbox instance has blacklisted magic constant name set

#### Parameters

string | $name | String of magic constant $name to query

#### Returns

boolean —

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

#

## Tags

None found

### hasWhitelistedNamespaces()

    hasWhitelistedNamespaces() : integer

Query whether PHPSandbox instance has whitelisted namespaces.

#### Returns

integer —

Returns the number of whitelisted namespaces this instance has defined

#

## Tags

None found

### hasBlacklistedNamespaces()

    hasBlacklistedNamespaces() : integer

Query whether PHPSandbox instance has blacklisted namespaces.

#### Returns

integer —

Returns the number of blacklisted namespaces this instance has defined

#

## Tags

None found

### isWhitelistedNamespace()

    isWhitelistedNamespace(string  $name) : boolean

Check if PHPSandbox instance has whitelisted namespace name set

#### Parameters

string | $name | String of namespace $name to query

#### Returns

boolean —

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

#

## Tags

None found

### isBlacklistedNamespace()

    isBlacklistedNamespace(string  $name) : boolean

Check if PHPSandbox instance has blacklisted namespace name set

#### Parameters

string | $name | String of namespace $name to query

#### Returns

boolean —

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

#

## Tags

None found

### hasWhitelistedAliases()

    hasWhitelistedAliases() : integer

Query whether PHPSandbox instance has whitelisted aliases.

#### Returns

integer —

Returns the number of whitelisted aliases this instance has defined

#

## Tags

None found

### hasBlacklistedAliases()

    hasBlacklistedAliases() : integer

Query whether PHPSandbox instance has blacklisted aliases.

#### Returns

integer —

Returns the number of blacklisted aliases this instance has defined

#

## Tags

None found

### isWhitelistedAlias()

    isWhitelistedAlias(string  $name) : boolean

Check if PHPSandbox instance has whitelisted alias name set

#### Parameters

string | $name | String of alias $name to query

#### Returns

boolean —

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

#

## Tags

None found

### isBlacklistedAlias()

    isBlacklistedAlias(string  $name) : boolean

Check if PHPSandbox instance has blacklisted alias name set

#### Parameters

string | $name | String of alias $name to query

#### Returns

boolean —

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

#

## Tags

None found

### hasWhitelistedUses()

    hasWhitelistedUses() : integer

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

#### Returns

integer —

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

#

## Tags

alias | hasWhitelistedAliases();

### hasBlacklistedUses()

    hasBlacklistedUses() : integer

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

#### Returns

integer —

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

#

## Tags

alias | hasBlacklistedAliases();

### isWhitelistedUse()

    isWhitelistedUse(string  $name) : boolean

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

#### Parameters

string | $name | String of use (or alias) $name to query

#### Returns

boolean —

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

#

## Tags

alias | isWhitelistedAlias();

### isBlacklistedUse()

    isBlacklistedUse(string  $name) : boolean

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

#### Parameters

string | $name | String of use (or alias) $name to query

#### Returns

boolean —

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

#

## Tags

alias | isBlacklistedAlias();

### hasWhitelistedClasses()

    hasWhitelistedClasses() : integer

Query whether PHPSandbox instance has whitelisted classes.

#### Returns

integer —

Returns the number of whitelisted classes this instance has defined

#

## Tags

None found

### hasBlacklistedClasses()

    hasBlacklistedClasses() : integer

Query whether PHPSandbox instance has blacklisted classes.

#### Returns

integer —

Returns the number of blacklisted classes this instance has defined

#

## Tags

None found

### isWhitelistedClass()

    isWhitelistedClass(string  $name) : boolean

Check if PHPSandbox instance has whitelisted class name set

#### Parameters

string | $name | String of class $name to query

#### Returns

boolean —

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

#

## Tags

None found

### isBlacklistedClass()

    isBlacklistedClass(string  $name) : boolean

Check if PHPSandbox instance has blacklisted class name set

#### Parameters

string | $name | String of class $name to query

#### Returns

boolean —

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

#

## Tags

None found

### hasWhitelistedInterfaces()

    hasWhitelistedInterfaces() : integer

Query whether PHPSandbox instance has whitelisted interfaces.

#### Returns

integer —

Returns the number of whitelisted interfaces this instance has defined

#

## Tags

None found

### hasBlacklistedInterfaces()

    hasBlacklistedInterfaces() : integer

Query whether PHPSandbox instance has blacklisted interfaces.

#### Returns

integer —

Returns the number of blacklisted interfaces this instance has defined

#

## Tags

None found

### isWhitelistedInterface()

    isWhitelistedInterface(string  $name) : boolean

Check if PHPSandbox instance has whitelisted interface name set

#### Parameters

string | $name | String of interface $name to query

#### Returns

boolean —

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

#

## Tags

None found

### isBlacklistedInterface()

    isBlacklistedInterface(string  $name) : boolean

Check if PHPSandbox instance has blacklisted interface name set

#### Parameters

string | $name | String of interface $name to query

#### Returns

boolean —

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

#

## Tags

None found

### hasWhitelistedTraits()

    hasWhitelistedTraits() : integer

Query whether PHPSandbox instance has whitelisted traits.

#### Returns

integer —

Returns the number of whitelisted traits this instance has defined

#

## Tags

None found

### hasBlacklistedTraits()

    hasBlacklistedTraits() : integer

Query whether PHPSandbox instance has blacklisted traits.

#### Returns

integer —

Returns the number of blacklisted traits this instance has defined

#

## Tags

None found

### isWhitelistedTrait()

    isWhitelistedTrait(string  $name) : boolean

Check if PHPSandbox instance has whitelisted trait name set

#### Parameters

string | $name | String of trait $name to query

#### Returns

boolean —

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

#

## Tags

None found

### isBlacklistedTrait()

    isBlacklistedTrait(string  $name) : boolean

Check if PHPSandbox instance has blacklisted trait name set

#### Parameters

string | $name | String of trait $name to query

#### Returns

boolean —

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

#

## Tags

None found

### hasWhitelistKeywords()

    hasWhitelistKeywords() : integer

Query whether PHPSandbox instance has whitelisted keywords.

#### Returns

integer —

Returns the number of whitelisted keywords this instance has defined

#

## Tags

None found

### hasBlacklistedKeywords()

    hasBlacklistedKeywords() : integer

Query whether PHPSandbox instance has blacklisted keywords.

#### Returns

integer —

Returns the number of blacklisted keywords this instance has defined

#

## Tags

None found

### isWhitelistedKeyword()

    isWhitelistedKeyword(string  $name) : boolean

Check if PHPSandbox instance has whitelisted keyword name set

#### Parameters

string | $name | String of keyword $name to query

#### Returns

boolean —

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

#

## Tags

None found

### isBlacklistedKeyword()

    isBlacklistedKeyword(string  $name) : boolean

Check if PHPSandbox instance has blacklisted keyword name set

#### Parameters

string | $name | String of keyword $name to query

#### Returns

boolean —

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

#

## Tags

None found

### hasWhitelistedOperators()

    hasWhitelistedOperators() : integer

Query whether PHPSandbox instance has whitelisted operators.

#### Returns

integer —

Returns the number of whitelisted operators this instance has defined

#

## Tags

None found

### hasBlacklistedOperators()

    hasBlacklistedOperators() : integer

Query whether PHPSandbox instance has blacklisted operators.

#### Returns

integer —

Returns the number of blacklisted operators this instance has defined

#

## Tags

None found

### isWhitelistedOperator()

    isWhitelistedOperator(string  $name) : boolean

Check if PHPSandbox instance has whitelisted operator name set

#### Parameters

string | $name | String of operator $name to query

#### Returns

boolean —

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

#

## Tags

None found

### isBlacklistedOperator()

    isBlacklistedOperator(string  $name) : boolean

Check if PHPSandbox instance has blacklisted operator name set

#### Parameters

string | $name | String of operator $name to query

#### Returns

boolean —

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

#

## Tags

None found

### hasWhitelistedPrimitives()

    hasWhitelistedPrimitives() : integer

Query whether PHPSandbox instance has whitelisted primitives.

#### Returns

integer —

Returns the number of whitelisted primitives this instance has defined

#

## Tags

None found

### hasBlacklistedPrimitives()

    hasBlacklistedPrimitives() : integer

Query whether PHPSandbox instance has blacklisted primitives.

#### Returns

integer —

Returns the number of blacklisted primitives this instance has defined

#

## Tags

None found

### isWhitelistedPrimitive()

    isWhitelistedPrimitive(string  $name) : boolean

Check if PHPSandbox instance has whitelisted primitive name set

#### Parameters

string | $name | String of primitive $name to query

#### Returns

boolean —

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

#

## Tags

None found

### isBlacklistedPrimitive()

    isBlacklistedPrimitive(string  $name) : boolean

Check if PHPSandbox instance has blacklisted primitive name set

#### Parameters

string | $name | String of primitive $name to query

#### Returns

boolean —

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

#

## Tags

None found

### hasWhitelistedTypes()

    hasWhitelistedTypes() : integer

Query whether PHPSandbox instance has whitelisted types.

#### Returns

integer —

Returns the number of whitelisted types this instance has defined

#

## Tags

None found

### hasBlacklistedTypes()

    hasBlacklistedTypes() : integer

Query whether PHPSandbox instance has blacklisted types.

#### Returns

integer —

Returns the number of blacklisted types this instance has defined

#

## Tags

None found

### isWhitelistedType()

    isWhitelistedType(string  $name) : boolean

Check if PHPSandbox instance has whitelisted type name set

#### Parameters

string | $name | String of type $name to query

#### Returns

boolean —

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

#

## Tags

None found

### isBlacklistedType()

    isBlacklistedType(string  $name) : boolean

Check if PHPSandbox instance has blacklisted type name set

#### Parameters

string | $name | String of type $name to query

#### Returns

boolean —

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

#

## Tags

None found

### whitelistFunc()

    whitelistFunc(string|array  $name) : $this

Whitelist function

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

#### Parameters

string|array | $name | String of function name, or array of function names to whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### blacklistFunc()

    blacklistFunc(string|array  $name) : $this

Blacklist function

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

#### Parameters

string|array | $name | String of function name, or array of function names to blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### dewhitelistFunc()

    dewhitelistFunc(string|array  $name) : $this

Remove function from whitelist

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

#### Parameters

string|array | $name | String of function name or array of function names to remove from whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### deblacklistFunc()

    deblacklistFunc(string|array  $name) : $this

Remove function from blacklist

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

#### Parameters

string|array | $name | String of function name or array of function names to remove from blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### whitelistVar()

    whitelistVar(string|array  $name) : $this

Whitelist variable

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

#### Parameters

string|array | $name | String of variable name or array of variable names to whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### blacklistVar()

    blacklistVar(string|array  $name) : $this

Blacklist variable

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

#### Parameters

string|array | $name | String of variable name or array of variable names to blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### dewhitelistVar()

    dewhitelistVar(string|array  $name) : $this

Remove variable from whitelist

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

#### Parameters

string|array | $name | String of variable name or array of variable names to remove from whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### deblacklistVar()

    deblacklistVar(string|array  $name) : $this

Remove function from blacklist

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

#### Parameters

string|array | $name | String of variable name or array of variable names to remove from blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### whitelistGlobal()

    whitelistGlobal(string|array  $name) : $this

Whitelist global

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

#### Parameters

string|array | $name | String of global name or array of global names to whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### blacklistGlobal()

    blacklistGlobal(string|array  $name) : $this

Blacklist global

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

#### Parameters

string|array | $name | String of global name or array of global names to blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### dewhitelistGlobal()

    dewhitelistGlobal(string|array  $name) : $this

Remove global from whitelist

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

#### Parameters

string|array | $name | String of global name or array of global names to remove from whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### deblacklistGlobal()

    deblacklistGlobal(string|array  $name) : $this

Remove global from blacklist

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

#### Parameters

string|array | $name | String of global name or array of global names to remove from blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### whitelistSuperglobal()

    whitelistSuperglobal(string|array  $name, string  $key = null) : $this

Whitelist 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 whitelist

#### Parameters

string|array | $name | String of superglobal name, or an array of superglobal names, or an associative array of superglobal names and their keys to whitelist
string | $key | String of superglobal key to whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### blacklistSuperglobal()

    blacklistSuperglobal(string|array  $name, string  $key = null) : $this

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

#### Parameters

string|array | $name | String of superglobal name, or an array of superglobal names, or an associative array of superglobal names and their keys to blacklist
string | $key | String of superglobal key to blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### dewhitelistSuperglobal()

    dewhitelistSuperglobal(string|array  $name, string  $key = null) : $this

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

#### Parameters

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

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### deblacklistSuperglobal()

    deblacklistSuperglobal(string|array  $name, string  $key = null) : $this

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

#### Parameters

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

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### whitelistConst()

    whitelistConst(string|array  $name) : $this

Whitelist constant

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

#### Parameters

string|array | $name | String of constant name or array of constant names to whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### blacklistConst()

    blacklistConst(string|array  $name) : $this

Blacklist constant

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

#### Parameters

string|array | $name | String of constant name or array of constant names to blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### dewhitelistConst()

    dewhitelistConst(string|array  $name) : $this

Remove constant from whitelist

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

#### Parameters

string|array | $name | String of constant name or array of constant names to remove from whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### deblacklistConst()

    deblacklistConst(string|array  $name) : $this

Remove constant from blacklist

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

#### Parameters

string|array | $name | String of constant name or array of constant names to remove from blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### whitelistMagicConst()

    whitelistMagicConst(string|array  $name) : $this

Whitelist magic constant

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

#### Parameters

string|array | $name | String of magic constant name or array of magic constant names to whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### blacklistMagicConst()

    blacklistMagicConst(string|array  $name) : $this

Blacklist magic constant

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

#### Parameters

string|array | $name | String of magic constant name or array of magic constant names to blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### dewhitelistMagicConst()

    dewhitelistMagicConst(string|array  $name) : $this

Remove magic constant from whitelist

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

#### Parameters

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

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### deblacklistMagicConst()

    deblacklistMagicConst(string|array  $name) : $this

Remove magic constant from blacklist

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

#### Parameters

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

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### whitelistNamespace()

    whitelistNamespace(string|array  $name) : $this

Whitelist namespace

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

#### Parameters

string|array | $name | String of namespace name or array of namespace names to whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### blacklistNamespace()

    blacklistNamespace(string|array  $name) : $this

Blacklist namespace

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

#### Parameters

string|array | $name | String of namespace name or array of namespace names to blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### dewhitelistNamespace()

    dewhitelistNamespace(string|array  $name) : $this

Remove namespace from whitelist

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

#### Parameters

string|array | $name | String of namespace name or array of namespace names to remove from whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### deblacklistNamespace()

    deblacklistNamespace(string|array  $name) : $this

Remove namespace from blacklist

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

#### Parameters

string|array | $name | String of namespace name or array of namespace names to remove from blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### whitelistAlias()

    whitelistAlias(string|array  $name) : $this

Whitelist alias

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

#### Parameters

string|array | $name | String of alias names or array of alias names to whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### blacklistAlias()

    blacklistAlias(string|array  $name) : $this

Blacklist alias

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

#### Parameters

string|array | $name | String of alias name or array of alias names to blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### dewhitelistAlias()

    dewhitelistAlias(string|array  $name) : $this

Remove alias from whitelist

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

#### Parameters

string|array | $name | String of alias name or array of alias names to remove from whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### deblacklistAlias()

    deblacklistAlias(string|array  $name) : $this

Remove alias from blacklist

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

#### Parameters

string|array | $name | String of alias name or array of alias names to remove from blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### whitelistUse()

    whitelistUse(string|array  $name) : $this

Whitelist use (or alias)

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

#### Parameters

string|array | $name | String of use (or alias) name or array of use (or alias) names to whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

alias | whitelistAlias();

### blacklistUse()

    blacklistUse(string|array  $name) : $this

Blacklist use (or alias)

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

#### Parameters

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

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

alias | blacklistAlias();

### dewhitelistUse()

    dewhitelistUse(string|array  $name) : $this

Remove use (or alias) from whitelist

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

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

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

alias | dewhitelistAlias();

### deblacklistUse()

    deblacklistUse(string|array  $name) : $this

Remove use (or alias) from blacklist

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

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

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

alias | deblacklistAlias();

### whitelistClass()

    whitelistClass(string|array  $name) : $this

Whitelist class

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

#### Parameters

string|array | $name | String of class name or array of class names to whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### blacklistClass()

    blacklistClass(string|array  $name) : $this

Blacklist class

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

#### Parameters

string|array | $name | String of class name or array of class names to blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### dewhitelistClass()

    dewhitelistClass(string|array  $name) : $this

Remove class from whitelist

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

#### Parameters

string|array | $name | String of class name or array of class names to remove from whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### deblacklistClass()

    deblacklistClass(string|array  $name) : $this

Remove class from blacklist

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

#### Parameters

string|array | $name | String of class name or array of class names to remove from blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### whitelistInterface()

    whitelistInterface(string|array  $name) : $this

Whitelist interface

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

#### Parameters

string|array | $name | String of interface name or array of interface names to whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### blacklistInterface()

    blacklistInterface(string|array  $name) : $this

Blacklist interface

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

#### Parameters

string|array | $name | String of interface name or array of interface names to blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### dewhitelistInterface()

    dewhitelistInterface(string|array  $name) : $this

Remove interface from whitelist

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

#### Parameters

string|array | $name | String of interface name or array of interface names to remove from whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### deblacklistInterface()

    deblacklistInterface(string|array  $name) : $this

Remove interface from blacklist

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

#### Parameters

string|array | $name | String of interface name or array of interface names to remove from blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### whitelistTrait()

    whitelistTrait(string|array  $name) : $this

Whitelist trait

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

#### Parameters

string|array | $name | String of trait name or array of trait names to whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### blacklistTrait()

    blacklistTrait(string|array  $name) : $this

Blacklist trait

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

#### Parameters

string|array | $name | String of trait name or array of trait names to blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### dewhitelistTrait()

    dewhitelistTrait(string|array  $name) : $this

Remove trait from whitelist

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

#### Parameters

string|array | $name | String of trait name or array of trait names to remove from whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### deblacklistTrait()

    deblacklistTrait(string|array  $name) : $this

Remove trait from blacklist

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

#### Parameters

string|array | $name | String of trait name or array of trait names to remove from blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### whitelistKeyword()

    whitelistKeyword(string|array  $name) : $this

Whitelist keyword

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

#### Parameters

string|array | $name | String of keyword name or array of keyword names to whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### blacklistKeyword()

    blacklistKeyword(string|array  $name) : $this

Blacklist keyword

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

#### Parameters

string|array | $name | String of keyword name or array of keyword names to blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### dewhitelistKeyword()

    dewhitelistKeyword(string|array  $name) : $this

Remove keyword from whitelist

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

#### Parameters

string|array | $name | String of keyword name or array of keyword names to remove from whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### deblacklistKeyword()

    deblacklistKeyword(string|array  $name) : $this

Remove keyword from blacklist

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

#### Parameters

string|array | $name | String of keyword name or array of keyword names to remove from blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### whitelistOperator()

    whitelistOperator(string|array  $name) : $this

Whitelist operator

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

#### Parameters

string|array | $name | String of operator name or array of operator names to whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### blacklistOperator()

    blacklistOperator(string|array  $name) : $this

Blacklist operator

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

#### Parameters

string|array | $name | String of operator name or array of operator names to blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### dewhitelistOperator()

    dewhitelistOperator(string|array  $name) : $this

Remove operator from whitelist

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

#### Parameters

string|array | $name | String of operator name or array of operator names to remove from whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### deblacklistOperator()

    deblacklistOperator(string|array  $name) : $this

Remove operator from blacklist

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

#### Parameters

string|array | $name | String of operator name or array of operator names to remove from blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### whitelistPrimitive()

    whitelistPrimitive(string|array  $name) : $this

Whitelist primitive

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

#### Parameters

string|array | $name | String of primitive name or array of primitive names to whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### blacklistPrimitive()

    blacklistPrimitive(string|array  $name) : $this

Blacklist primitive

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

#### Parameters

string|array | $name | String of primitive name or array of primitive names to blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### dewhitelistPrimitive()

    dewhitelistPrimitive(string|array  $name) : $this

Remove primitive from whitelist

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

#### Parameters

string|array | $name | String of primitive name or array of primitive names to remove from whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### deblacklistPrimitive()

    deblacklistPrimitive(string|array  $name) : $this

Remove primitive from blacklist

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

#### Parameters

string|array | $name | String of primitive name or array of primitive names to remove from blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### whitelistType()

    whitelistType(string|array  $name) : $this

Whitelist type

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

#### Parameters

string|array | $name | String of type name or array of type names to whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### blacklistType()

    blacklistType(string|array  $name) : $this

Blacklist type

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

#### Parameters

string|array | $name | String of type name or array of type names to blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### dewhitelistType()

    dewhitelistType(string|array  $name) : $this

Remove type from whitelist

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

#### Parameters

string|array | $name | String of type name or array of type names to remove from whitelist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### deblacklistType()

    deblacklistType(string|array  $name) : $this

Remove type from blacklist

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

#### Parameters

string|array | $name | String of type name or array of type names to remove from blacklist

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### checkFunc()

    checkFunc(string  $name) : boolean

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

#### Parameters

string | $name | String of the function name to check

#### Throws

\PHPSandbox\Error

  Throws exception if validation error occurs

#### Returns

boolean —

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

#

## Tags

None found

### checkVar()

    checkVar(string  $name) : boolean

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

#### Parameters

string | $name | String of the variable name to check

#### Throws

\PHPSandbox\Error

  Throws exception if validation error occurs

#### Returns

boolean —

Returns true if variable is valid

#

## Tags

None found

### checkGlobal()

    checkGlobal(string  $name) : boolean

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

#### Parameters

string | $name | String of the global name to check

#### Throws

\PHPSandbox\Error

  Throws exception if validation error occurs

#### Returns

boolean —

Returns true if global is valid

#

## Tags

None found

### checkSuperglobal()

    checkSuperglobal(string  $name) : boolean

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

#### Parameters

string | $name | String of the superglobal name to check

#### Throws

\PHPSandbox\Error

  Throws exception if validation error occurs

#### Returns

boolean —

Returns true if superglobal is valid

#

## Tags

None found

### checkConst()

    checkConst(string  $name) : boolean

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

#### Parameters

string | $name | String of the constant name to check

#### Throws

\PHPSandbox\Error

  Throws exception if validation error occurs

#### Returns

boolean —

Returns true if constant is valid

#

## Tags

None found

### checkMagicConst()

    checkMagicConst(string  $name) : boolean

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

#### Parameters

string | $name | String of the magic constant name to check

#### Throws

\PHPSandbox\Error

  Throws exception if validation error occurs

#### Returns

boolean —

Returns true if magic constant is valid

#

## Tags

None found

### checkNamespace()

    checkNamespace(string  $name) : boolean

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

#### Parameters

string | $name | String of the namespace name to check

#### Throws

\PHPSandbox\Error

  Throws exception if validation error occurs

#### Returns

boolean —

Returns true if namespace is valid

#

## Tags

None found

### checkAlias()

    checkAlias(string  $name) : boolean

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

#### Parameters

string | $name | String of the alias name to check

#### Throws

\PHPSandbox\Error

  Throws exception if validation error occurs

#### Returns

boolean —

Returns true if alias is valid

#

## Tags

None found

### checkUse()

    checkUse(string  $name) : boolean

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

#### Parameters

string | $name | String of the use (or alias) name to check

#### Throws

\PHPSandbox\Error

  Throws exception if validation error occurs

#### Returns

boolean —

Returns true if use (or alias) is valid

#

## Tags

alias | checkAlias();

### checkClass()

    checkClass(string  $name, boolean  $extends = false) : boolean

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

#### Parameters

string | $name | String of the class name to check
boolean | $extends | Flag whether this is an extended class

#### Throws

\PHPSandbox\Error

  Throws exception if validation error occurs

#### Returns

boolean —

Returns true if class is valid

#

## Tags

None found

### checkInterface()

    checkInterface(string  $name) : boolean

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

#### Parameters

string | $name | String of the interface name to check

#### Throws

\PHPSandbox\Error

  Throws exception if validation error occurs

#### Returns

boolean —

Returns true if interface is valid

#

## Tags

None found

### checkTrait()

    checkTrait(string  $name) : boolean

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

#### Parameters

string | $name | String of the trait name to check

#### Throws

\PHPSandbox\Error

  Throws exception if validation error occurs

#### Returns

boolean —

Returns true if trait is valid

#

## Tags

None found

### checkKeyword()

    checkKeyword(string  $name) : boolean

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

#### Parameters

string | $name | String of the keyword name to check

#### Throws

\PHPSandbox\Error

  Throws exception if validation error occurs

#### Returns

boolean —

Returns true if keyword is valid

#

## Tags

None found

### checkOperator()

    checkOperator(string  $name) : boolean

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

#### Parameters

string | $name | String of the type operator to check

#### Throws

\PHPSandbox\Error

  Throws exception if validation error occurs

#### Returns

boolean —

Returns true if operator is valid

#

## Tags

None found

### checkPrimitive()

    checkPrimitive(string  $name) : boolean

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

#### Parameters

string | $name | String of the primitive name to check

#### Throws

\PHPSandbox\Error

  Throws exception if validation error occurs

#### Returns

boolean —

Returns true if primitive is valid

#

## Tags

None found

### checkType()

    checkType(string  $name) : boolean

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

#### Parameters

string | $name | String of the type name to check

#### Throws

\PHPSandbox\Error

  Throws exception if validation error occurs

#### Returns

boolean —

Returns true if type is valid

#

## Tags

None found

### prepend()

    prepend(string|callable  $code) : $this

Prepend trusted code

#### Parameters

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

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### append()

    append(string|callable  $code) : $this

Append trusted code

#### Parameters

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

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### clear()

    clear() : $this

Clear all trusted and sandboxed code

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### clearTrustedCode()

    clearTrustedCode() : $this

Clear all trusted code

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### clearPrepended()

    clearPrepended() : $this

Clear all prepended trusted code

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### clearPrependedCode()

    clearPrependedCode() : $this

Clear all prepended trusted code

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

alias | $this->clearPrepended()

### clearAppend()

    clearAppend() : $this

Clear all appended trusted code

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### clearAppendedCode()

    clearAppendedCode() : $this

Clear all appended trusted code

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

alias | $this->clearAppend()

### clearCode()

    clearCode() : $this

Clear generated code

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### getPreparedTime()

    getPreparedTime(integer|null  $round) : float

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

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

#### Parameters

integer|null | $round | The number of digits to round the return value

#### Returns

float —

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

#

## Tags

None found

### getExecutionTime()

    getExecutionTime(integer|null  $round) : float

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

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

#### Parameters

integer|null | $round | The number of digits to round the return value

#### Returns

float —

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

#

## Tags

None found

### getTime()

    getTime(integer|null  $round) : float

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

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

#### Parameters

integer|null | $round | The number of digits to round the return value

#### Returns

float —

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

#

## Tags

None found

### getMemoryUsage()

    getMemoryUsage(integer|null  $round) : integer

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

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

#### Parameters

integer|null | $round | The number of digits to round the return value

#### Returns

integer —

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

#

## Tags

None found

### validate()

    validate(callable|string  $code) : $this

Validate passed callable for execution

#### Parameters

callable|string | $code | The callable or string of code to validate

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### prepare()

    prepare(callable  $code, boolean  $skip_validation = false) : string

Prepare passed callable for execution

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

#### Parameters

callable | $code | The callable to prepare for execution
boolean | $skip_validation | Boolean flag to indicate whether the sandbox should skip validation. Default is false.

#### Throws

\PHPSandbox\Error

  Throws exception if error occurs in parsing, validation or whitelisting

#### Returns

string —

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

#

## Tags

None found

### execute()

    execute(callable|string  $callable = null, boolean  $skip_validation = false) : mixed

Prepare and execute callable and return output

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

#### Parameters

callable|string | $callable | Callable or string of PHP code to prepare and execute within the sandbox
boolean | $skip_validation | Boolean flag to indicate whether the sandbox should skip validation of the pass callable. Default is false.

#### Throws

\PHPSandbox\Error

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

#### Returns

mixed —

The output from the executed sandboxed code

#

## Tags

None found

### setErrorHandler()

    setErrorHandler(callable  $handler, integer  $error_types = E_ALL) : $this

Set callable to handle errors

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

callable | $handler | Callable to handle thrown Errors
integer | $error_types | Integer flag of the error types to handle (default is E_ALL)

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### getErrorHandler()

    getErrorHandler() : null|callable

Get error handler

This function returns the sandbox error handler.

#### Returns

null|callable

#

## Tags

None found

### unsetErrorHandler()

    unsetErrorHandler() : $this

Unset error handler

This function unsets the sandbox error handler.

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### getLastError()

    getLastError() : array

Gets the last sandbox error

#### Returns

array

#

## Tags

None found

### error()

    error(integer  $errno, string  $errstr, string  $errfile, integer  $errline, array  $errcontext) : mixed

Invoke sandbox error handler

#### Parameters

integer | $errno | Error number
string | $errstr | Error message
string | $errfile | Error file
integer | $errline | Error line number
array | $errcontext | Error context array

#### Returns

mixed

#

## Tags

None found

### setExceptionHandler()

    setExceptionHandler(callable  $handler) : $this

Set callable to handle thrown exceptions

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

callable | $handler | Callable to handle thrown exceptions

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### getExceptionHandler()

    getExceptionHandler() : null|callable

Get exception handler

This function returns the sandbox exception handler.

#### Returns

null|callable

#

## Tags

None found

### unsetExceptionHandler()

    unsetExceptionHandler() : $this

Unset exception handler

This function unsets the sandbox exception handler.

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### getLastException()

    getLastException() : \Exception|\PHPSandbox\Error

Gets the last exception thrown by the sandbox

#### Returns

\Exception|\PHPSandbox\Error

#

## Tags

None found

### exception()

    exception(\Exception  $exception) : mixed

Invoke sandbox exception handler

#### Parameters

\Exception | $exception | Error number

#### Throws

\Exception

#### Returns

mixed

#

## Tags

None found

### setValidationErrorHandler()

    setValidationErrorHandler(callable  $handler) : $this

Set callable to handle thrown validation Errors

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

callable | $handler | Callable to handle thrown validation Errors

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### getValidationErrorHandler()

    getValidationErrorHandler() : null|callable

Get validation error handler

This function returns the sandbox validation error handler.

#### Returns

null|callable

#

## Tags

None found

### unsetValidationErrorHandler()

    unsetValidationErrorHandler() : $this

Unset validation error handler

This function unsets the sandbox validation error handler.

#### Returns

$this —

Returns the PHPSandbox instance for fluent querying

#

## Tags

None found

### getLastValidationError()

    getLastValidationError() : \Exception|\PHPSandbox\Error

Gets the last validation error thrown by the sandbox

#### Returns

\Exception|\PHPSandbox\Error

#

## Tags

None found

### validationError()

    validationError(\Exception|\PHPSandbox\Error|string  $error, integer  $code, \PhpParser\Node|null  $node = null, mixed  $data = null, \Exception|\PHPSandbox\Error|null  $previous = null) : mixed

Invoke sandbox error validation handler if it exists, throw Error otherwise

#### Parameters

\Exception|\PHPSandbox\Error|string | $error | Error to throw if Error is not handled, or error message string
integer | $code | The error code
\PhpParser\Node|null | $node | The error parser node
mixed | $data | The error data
\Exception|\PHPSandbox\Error|null | $previous | The previous Error thrown

#### Throws

\Exception|\PHPSandbox\Error

#### Returns

mixed

#

## Tags

None found

### getSandbox()

    getSandbox(string  $name) : null|\PHPSandbox\PHPSandbox

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

#### Parameters

string | $name | The name of the PHPSandbox instance to retrieve

#### Returns

null|\PHPSandbox\PHPSandbox

#

static

## Tags

None found

### getIterator()

    getIterator() : array

Get an iterator of all the public PHPSandbox properties

#### Returns

array

#

## Tags

None found

### __call()

    __call(string  $method, array  $arguments) : mixed

Magic method to provide API compatibility for v1.* code

#### Parameters

string | $method | The method name to call
array | $arguments | The method arguments to call

#### Returns

mixed

#

## Tags

None found

### define_func()

    define_func() : void

#

## Tags

None found

### define_funcs()

    define_funcs() : void

#

## Tags

None found

### has_defined_funcs()

    has_defined_funcs() : void

#

## Tags

None found

### is_defined_func()

    is_defined_func() : void

#

## Tags

None found

### undefine_func()

    undefine_func() : void

#

## Tags

None found

### undefine_funcs()

    undefine_funcs() : void

#

## Tags

None found

### define_var()

    define_var() : void

#

## Tags

None found

### define_vars()

    define_vars() : void

#

## Tags

None found

### has_defined_vars()

    has_defined_vars() : void

#

## Tags

None found

### is_defined_var()

    is_defined_var() : void

#

## Tags

None found

### undefine_var()

    undefine_var() : void

#

## Tags

None found

### undefine_vars()

    undefine_vars() : void

#

## Tags

None found

### define_superglobal()

    define_superglobal() : void

#

## Tags

None found

### define_superglobals()

    define_superglobals() : void

#

## Tags

None found

### has_defined_superglobals()

    has_defined_superglobals() : void

#

## Tags

None found

### is_defined_superglobal()

    is_defined_superglobal() : void

#

## Tags

None found

### undefine_superglobal()

    undefine_superglobal() : void

#

## Tags

None found

### undefine_superglobals()

    undefine_superglobals() : void

#

## Tags

None found

### define_const()

    define_const() : void

#

## Tags

None found

### define_consts()

    define_consts() : void

#

## Tags

None found

### has_defined_consts()

    has_defined_consts() : void

#

## Tags

None found

### is_defined_const()

    is_defined_const() : void

#

## Tags

None found

### undefine_const()

    undefine_const() : void

#

## Tags

None found

### undefine_consts()

    undefine_consts() : void

#

## Tags

None found

### define_magic_const()

    define_magic_const() : void

#

## Tags

None found

### define_magic_consts()

    define_magic_consts() : void

#

## Tags

None found

### has_defined_magic_consts()

    has_defined_magic_consts() : void

#

## Tags

None found

### is_defined_magic_const()

    is_defined_magic_const() : void

#

## Tags

None found

### undefine_magic_const()

    undefine_magic_const() : void

#

## Tags

None found

### undefine_magic_consts()

    undefine_magic_consts() : void

#

## Tags

None found

### define_namespace()

    define_namespace() : void

#

## Tags

None found

### define_namespaces()

    define_namespaces() : void

#

## Tags

None found

### has_defined_namespaces()

    has_defined_namespaces() : void

#

## Tags

None found

### is_defined_namespace()

    is_defined_namespace() : void

#

## Tags

None found

### get_defined_namespace()

    get_defined_namespace() : void

#

## Tags

None found

### undefine_namespace()

    undefine_namespace() : void

#

## Tags

None found

### undefine_namespaces()

    undefine_namespaces() : void

#

## Tags

None found

### define_alias()

    define_alias() : void

#

## Tags

None found

### define_aliases()

    define_aliases() : void

#

## Tags

None found

### has_defined_aliases()

    has_defined_aliases() : void

#

## Tags

None found

### is_defined_alias()

    is_defined_alias() : void

#

## Tags

None found

### undefine_alias()

    undefine_alias() : void

#

## Tags

None found

### undefine_aliases()

    undefine_aliases() : void

#

## Tags

None found

### define_use()

    define_use() : void

#

## Tags

None found

### define_uses()

    define_uses() : void

#

## Tags

None found

### has_defined_uses()

    has_defined_uses() : void

#

## Tags

None found

### is_defined_use()

    is_defined_use() : void

#

## Tags

None found

### undefine_use()

    undefine_use() : void

#

## Tags

None found

### undefine_uses()

    undefine_uses() : void

#

## Tags

None found

### define_class()

    define_class() : void

#

## Tags

None found

### define_classes()

    define_classes() : void

#

## Tags

None found

### has_defined_classes()

    has_defined_classes() : void

#

## Tags

None found

### is_defined_class()

    is_defined_class() : void

#

## Tags

None found

### get_defined_class()

    get_defined_class() : void

#

## Tags

None found

### undefine_class()

    undefine_class() : void

#

## Tags

None found

### undefine_classes()

    undefine_classes() : void

#

## Tags

None found

### define_interface()

    define_interface() : void

#

## Tags

None found

### define_interfaces()

    define_interfaces() : void

#

## Tags

None found

### has_defined_interfaces()

    has_defined_interfaces() : void

#

## Tags

None found

### is_defined_interface()

    is_defined_interface() : void

#

## Tags

None found

### get_defined_interface()

    get_defined_interface() : void

#

## Tags

None found

### undefine_interface()

    undefine_interface() : void

#

## Tags

None found

### undefine_interfaces()

    undefine_interfaces() : void

#

## Tags

None found

### define_trait()

    define_trait() : void

#

## Tags

None found

### define_traits()

    define_traits() : void

#

## Tags

None found

### has_defined_traits()

    has_defined_traits() : void

#

## Tags

None found

### is_defined_trait()

    is_defined_trait() : void

#

## Tags

None found

### get_defined_trait()

    get_defined_trait() : void

#

## Tags

None found

### undefine_trait()

    undefine_trait() : void

#

## Tags

None found

### undefine_traits()

    undefine_traits() : void

#

## Tags

None found

### has_whitelist()

    has_whitelist() : void

#

## Tags

None found

### has_blacklist()

    has_blacklist() : void

#

## Tags

None found

### is_whitelisted()

    is_whitelisted() : void

#

## Tags

None found

### is_blacklisted()

    is_blacklisted() : void

#

## Tags

None found

### has_whitelist_funcs()

    has_whitelist_funcs() : void

#

## Tags

None found

### has_blacklist_funcs()

    has_blacklist_funcs() : void

#

## Tags

None found

### is_whitelisted_func()

    is_whitelisted_func() : void

#

## Tags

None found

### is_blacklisted_func()

    is_blacklisted_func() : void

#

## Tags

None found

### has_whitelist_vars()

    has_whitelist_vars() : void

#

## Tags

None found

### has_blacklist_vars()

    has_blacklist_vars() : void

#

## Tags

None found

### is_whitelisted_var()

    is_whitelisted_var() : void

#

## Tags

None found

### is_blacklisted_var()

    is_blacklisted_var() : void

#

## Tags

None found

### has_whitelist_globals()

    has_whitelist_globals() : void

#

## Tags

None found

### has_blacklist_globals()

    has_blacklist_globals() : void

#

## Tags

None found

### is_whitelisted_global()

    is_whitelisted_global() : void

#

## Tags

None found

### is_blacklisted_global()

    is_blacklisted_global() : void

#

## Tags

None found

### has_whitelist_superglobals()

    has_whitelist_superglobals() : void

#

## Tags

None found

### has_blacklist_superglobals()

    has_blacklist_superglobals() : void

#

## Tags

None found

### is_whitelisted_superglobal()

    is_whitelisted_superglobal() : void

#

## Tags

None found

### is_blacklisted_superglobal()

    is_blacklisted_superglobal() : void

#

## Tags

None found

### has_whitelist_consts()

    has_whitelist_consts() : void

#

## Tags

None found

### has_blacklist_consts()

    has_blacklist_consts() : void

#

## Tags

None found

### is_whitelisted_const()

    is_whitelisted_const() : void

#

## Tags

None found

### is_blacklisted_const()

    is_blacklisted_const() : void

#

## Tags

None found

### has_whitelist_magic_consts()

    has_whitelist_magic_consts() : void

#

## Tags

None found

### has_blacklist_magic_consts()

    has_blacklist_magic_consts() : void

#

## Tags

None found

### is_whitelisted_magic_const()

    is_whitelisted_magic_const() : void

#

## Tags

None found

### is_blacklisted_magic_const()

    is_blacklisted_magic_const() : void

#

## Tags

None found

### has_whitelist_namespaces()

    has_whitelist_namespaces() : void

#

## Tags

None found

### has_blacklist_namespaces()

    has_blacklist_namespaces() : void

#

## Tags

None found

### is_whitelisted_namespace()

    is_whitelisted_namespace() : void

#

## Tags

None found

### is_blacklisted_namespace()

    is_blacklisted_namespace() : void

#

## Tags

None found

### has_whitelist_aliases()

    has_whitelist_aliases() : void

#

## Tags

None found

### has_blacklist_aliases()

    has_blacklist_aliases() : void

#

## Tags

None found

### is_whitelisted_alias()

    is_whitelisted_alias() : void

#

## Tags

None found

### is_blacklisted_alias()

    is_blacklisted_alias() : void

#

## Tags

None found

### has_whitelist_uses()

    has_whitelist_uses() : void

#

## Tags

None found

### has_blacklist_uses()

    has_blacklist_uses() : void

#

## Tags

None found

### is_whitelisted_use()

    is_whitelisted_use() : void

#

## Tags

None found

### is_blacklisted_use()

    is_blacklisted_use() : void

#

## Tags

None found

### has_whitelist_classes()

    has_whitelist_classes() : void

#

## Tags

None found

### has_blacklist_classes()

    has_blacklist_classes() : void

#

## Tags

None found

### is_whitelisted_class()

    is_whitelisted_class() : void

#

## Tags

None found

### is_blacklisted_class()

    is_blacklisted_class() : void

#

## Tags

None found

### has_whitelist_interfaces()

    has_whitelist_interfaces() : void

#

## Tags

None found

### has_blacklist_interfaces()

    has_blacklist_interfaces() : void

#

## Tags

None found

### is_whitelisted_interface()

    is_whitelisted_interface() : void

#

## Tags

None found

### is_blacklisted_interface()

    is_blacklisted_interface() : void

#

## Tags

None found

### has_whitelist_traits()

    has_whitelist_traits() : void

#

## Tags

None found

### has_blacklist_traits()

    has_blacklist_traits() : void

#

## Tags

None found

### is_whitelisted_trait()

    is_whitelisted_trait() : void

#

## Tags

None found

### is_blacklisted_trait()

    is_blacklisted_trait() : void

#

## Tags

None found

### has_whitelist_keywords()

    has_whitelist_keywords() : void

#

## Tags

None found

### has_blacklist_keywords()

    has_blacklist_keywords() : void

#

## Tags

None found

### is_whitelisted_keyword()

    is_whitelisted_keyword() : void

#

## Tags

None found

### is_blacklisted_keyword()

    is_blacklisted_keyword() : void

#

## Tags

None found

### has_whitelist_operators()

    has_whitelist_operators() : void

#

## Tags

None found

### has_blacklist_operators()

    has_blacklist_operators() : void

#

## Tags

None found

### is_whitelisted_operator()

    is_whitelisted_operator() : void

#

## Tags

None found

### is_blacklisted_operator()

    is_blacklisted_operator() : void

#

## Tags

None found

### has_whitelist_primitives()

    has_whitelist_primitives() : void

#

## Tags

None found

### has_blacklist_primitives()

    has_blacklist_primitives() : void

#

## Tags

None found

### is_whitelisted_primitive()

    is_whitelisted_primitive() : void

#

## Tags

None found

### is_blacklisted_primitive()

    is_blacklisted_primitive() : void

#

## Tags

None found

### has_whitelist_types()

    has_whitelist_types() : void

#

## Tags

None found

### has_blacklist_types()

    has_blacklist_types() : void

#

## Tags

None found

### is_whitelisted_type()

    is_whitelisted_type() : void

#

## Tags

None found

### is_blacklisted_type()

    is_blacklisted_type() : void

#

## Tags

None found

### whitelist_func()

    whitelist_func() : void

#

## Tags

None found

### blacklist_func()

    blacklist_func() : void

#

## Tags

None found

### dewhitelist_func()

    dewhitelist_func() : void

#

## Tags

None found

### deblacklist_func()

    deblacklist_func() : void

#

## Tags

None found

### whitelist_var()

    whitelist_var() : void

#

## Tags

None found

### blacklist_var()

    blacklist_var() : void

#

## Tags

None found

### dewhitelist_var()

    dewhitelist_var() : void

#

## Tags

None found

### deblacklist_var()

    deblacklist_var() : void

#

## Tags

None found

### whitelist_global()

    whitelist_global() : void

#

## Tags

None found

### blacklist_global()

    blacklist_global() : void

#

## Tags

None found

### dewhitelist_global()

    dewhitelist_global() : void

#

## Tags

None found

### deblacklist_global()

    deblacklist_global() : void

#

## Tags

None found

### whitelist_superglobal()

    whitelist_superglobal() : void

#

## Tags

None found

### blacklist_superglobal()

    blacklist_superglobal() : void

#

## Tags

None found

### dewhitelist_superglobal()

    dewhitelist_superglobal() : void

#

## Tags

None found

### deblacklist_superglobal()

    deblacklist_superglobal() : void

#

## Tags

None found

### whitelist_const()

    whitelist_const() : void

#

## Tags

None found

### blacklist_const()

    blacklist_const() : void

#

## Tags

None found

### dewhitelist_const()

    dewhitelist_const() : void

#

## Tags

None found

### deblacklist_const()

    deblacklist_const() : void

#

## Tags

None found

### whitelist_magic_const()

    whitelist_magic_const() : void

#

## Tags

None found

### blacklist_magic_const()

    blacklist_magic_const() : void

#

## Tags

None found

### dewhitelist_magic_const()

    dewhitelist_magic_const() : void

#

## Tags

None found

### deblacklist_magic_const()

    deblacklist_magic_const() : void

#

## Tags

None found

### whitelist_namespace()

    whitelist_namespace() : void

#

## Tags

None found

### blacklist_namespace()

    blacklist_namespace() : void

#

## Tags

None found

### dewhitelist_namespace()

    dewhitelist_namespace() : void

#

## Tags

None found

### deblacklist_namespace()

    deblacklist_namespace() : void

#

## Tags

None found

### whitelist_alias()

    whitelist_alias() : void

#

## Tags

None found

### blacklist_alias()

    blacklist_alias() : void

#

## Tags

None found

### dewhitelist_alias()

    dewhitelist_alias() : void

#

## Tags

None found

### deblacklist_alias()

    deblacklist_alias() : void

#

## Tags

None found

### whitelist_use()

    whitelist_use() : void

#

## Tags

None found

### blacklist_use()

    blacklist_use() : void

#

## Tags

None found

### dewhitelist_use()

    dewhitelist_use() : void

#

## Tags

None found

### deblacklist_use()

    deblacklist_use() : void

#

## Tags

None found

### whitelist_class()

    whitelist_class() : void

#

## Tags

None found

### blacklist_class()

    blacklist_class() : void

#

## Tags

None found

### dewhitelist_class()

    dewhitelist_class() : void

#

## Tags

None found

### deblacklist_class()

    deblacklist_class() : void

#

## Tags

None found

### whitelist_interface()

    whitelist_interface() : void

#

## Tags

None found

### blacklist_interface()

    blacklist_interface() : void

#

## Tags

None found

### dewhitelist_interface()

    dewhitelist_interface() : void

#

## Tags

None found

### deblacklist_interface()

    deblacklist_interface() : void

#

## Tags

None found

### whitelist_trait()

    whitelist_trait() : void

#

## Tags

None found

### blacklist_trait()

    blacklist_trait() : void

#

## Tags

None found

### dewhitelist_trait()

    dewhitelist_trait() : void

#

## Tags

None found

### deblacklist_trait()

    deblacklist_trait() : void

#

## Tags

None found

### whitelist_keyword()

    whitelist_keyword() : void

#

## Tags

None found

### blacklist_keyword()

    blacklist_keyword() : void

#

## Tags

None found

### dewhitelist_keyword()

    dewhitelist_keyword() : void

#

## Tags

None found

### deblacklist_keyword()

    deblacklist_keyword() : void

#

## Tags

None found

### whitelist_operator()

    whitelist_operator() : void

#

## Tags

None found

### blacklist_operator()

    blacklist_operator() : void

#

## Tags

None found

### dewhitelist_operator()

    dewhitelist_operator() : void

#

## Tags

None found

### deblacklist_operator()

    deblacklist_operator() : void

#

## Tags

None found

### whitelist_primitive()

    whitelist_primitive() : void

#

## Tags

None found

### blacklist_primitive()

    blacklist_primitive() : void

#

## Tags

None found

### dewhitelist_primitive()

    dewhitelist_primitive() : void

#

## Tags

None found

### deblacklist_primitive()

    deblacklist_primitive() : void

#

## Tags

None found

### whitelist_type()

    whitelist_type() : void

#

## Tags

None found

### blacklist_type()

    blacklist_type() : void

#

## Tags

None found

### dewhitelist_type()

    dewhitelist_type() : void

#

## Tags

None found

### deblacklist_type()

    deblacklist_type() : void

#

## Tags

None found

### check_func()

    check_func() : void

#

## Tags

None found

### check_var()

    check_var() : void

#

## Tags

None found

### check_global()

    check_global() : void

#

## Tags

None found

### check_superglobal()

    check_superglobal() : void

#

## Tags

None found

### check_const()

    check_const() : void

#

## Tags

None found

### check_magic_const()

    check_magic_const() : void

#

## Tags

None found

### check_namespace()

    check_namespace() : void

#

## Tags

None found

### check_alias()

    check_alias() : void

#

## Tags

None found

### check_use()

    check_use() : void

#

## Tags

None found

### check_class()

    check_class() : void

#

## Tags

None found

### check_interface()

    check_interface() : void

#

## Tags

None found

### check_trait()

    check_trait() : void

#

## Tags

None found

### check_keyword()

    check_keyword() : void

#

## Tags

None found

### check_operator()

    check_operator() : void

#

## Tags

None found

### check_primitive()

    check_primitive() : void

#

## Tags

None found

### check_type()

    check_type() : void

#

## Tags

None found

### clear_trusted_code()

    clear_trusted_code() : void

#

## Tags

None found

### clear_prepend()

    clear_prepend() : void

#

## Tags

None found

### clear_append()

    clear_append() : void

#

## Tags

None found

### clear_code()

    clear_code() : void

#

## Tags

None found

### get_prepared_time()

    get_prepared_time() : void

#

## Tags

None found

### get_execution_time()

    get_execution_time() : void

#

## Tags

None found

### get_time()

    get_time() : void

#

## Tags

None found

### set_error_handler()

    set_error_handler() : void

#

## Tags

None found

### get_error_handler()

    get_error_handler() : void

#

## Tags

None found

### unset_error_handler()

    unset_error_handler() : void

#

## Tags

None found

### get_last_error()

    get_last_error() : void

#

## Tags

None found

### set_exception_handler()

    set_exception_handler() : void

#

## Tags

None found

### get_exception_handler()

    get_exception_handler() : void

#

## Tags

None found

### unset_exception_handler()

    unset_exception_handler() : void

#

## Tags

None found

### get_last_exception()

    get_last_exception() : void

#

## Tags

None found

### set_validation_error_handler()

    set_validation_error_handler() : void

#

## Tags

None found

### get_validation_error_handler()

    get_validation_error_handler() : void

#

## Tags

None found

### unset_validation_error_handler()

    unset_validation_error_handler() : void

#

## Tags

None found

### get_last_validation_error()

    get_last_validation_error() : void

#

## Tags

None found

### validation_error()

    validation_error() : void

#

## Tags

None found

### normalize_func()

    normalize_func() : void

#

## Tags

None found

### normalize_superglobal()

    normalize_superglobal() : void

#

## Tags

None found

### normalize_magic_const()

    normalize_magic_const() : void

#

## Tags

None found

### normalize_namespace()

    normalize_namespace() : void

#

## Tags

None found

### normalize_alias()

    normalize_alias() : void

#

## Tags

None found

### normalize_use()

    normalize_use() : void

#

## Tags

None found

### normalize_class()

    normalize_class() : void

#

## Tags

None found

### normalize_interface()

    normalize_interface() : void

#

## Tags

None found

### normalize_trait()

    normalize_trait() : void

#

## Tags

None found

### normalize_keyword()

    normalize_keyword() : void

#

## Tags

None found

### normalize_operator()

    normalize_operator() : void

#

## Tags

None found

### normalize_primitive()

    normalize_primitive() : void

#

## Tags

None found

### normalize_type()

    normalize_type() : void

#

## Tags

None found

### prepare_vars()

    prepare_vars() : void

#

## Tags

None found

### prepare_consts()

    prepare_consts() : void

#

## Tags

None found

### prepare_namespaces()

    prepare_namespaces() : void

#

## Tags

None found

### prepare_aliases()

    prepare_aliases() : void

#

## Tags

None found

### prepare_uses()

    prepare_uses() : void

#

## Tags

None found

### auto_whitelist()

    auto_whitelist() : void

#

## Tags

None found

### auto_define()

    auto_define() : void

#

## Tags

None found

### normalizeFunc()

    normalizeFunc(string|array  $name) : string|array

Normalize function name. This is an internal PHPSandbox function.

#### Parameters

string|array | $name | String of the function $name, or array of strings to normalize

#### Returns

string|array —

Returns the normalized function string or an array of normalized strings

#

## Tags

None found

### normalizeSuperglobal()

    normalizeSuperglobal(string|array  $name) : string|array

Normalize superglobal name. This is an internal PHPSandbox function.

#### Parameters

string|array | $name | String of the superglobal $name, or array of strings to normalize

#### Returns

string|array —

Returns the normalized superglobal string or an array of normalized strings

#

## Tags

None found

### normalizeMagicConst()

    normalizeMagicConst(string|array  $name) : string|array

Normalize magic constant name. This is an internal PHPSandbox function.

#### Parameters

string|array | $name | String of the magic constant $name, or array of strings to normalize

#### Returns

string|array —

Returns the normalized magic constant string or an array of normalized strings

#

## Tags

None found

### normalizeNamespace()

    normalizeNamespace(string|array  $name) : string|array

Normalize namespace name. This is an internal PHPSandbox function.

#### Parameters

string|array | $name | String of the namespace $name, or array of strings to normalize

#### Returns

string|array —

Returns the normalized namespace string or an array of normalized strings

#

## Tags

None found

### normalizeAlias()

    normalizeAlias(string|array  $name) : string|array

Normalize alias name. This is an internal PHPSandbox function.

#### Parameters

string|array | $name | String of the alias $name, or array of strings to normalize

#### Returns

string|array —

Returns the normalized alias string or an array of normalized strings

#

## Tags

None found

### normalizeUse()

    normalizeUse(string|array  $name) : string|array

Normalize use (or alias) name. This is an internal PHPSandbox function.

#### Parameters

string|array | $name | String of the use (or alias) $name, or array of strings to normalize

#### Returns

string|array —

Returns the normalized use (or alias) string or an array of normalized strings

#

## Tags

alias | normalizeAlias();

### normalizeClass()

    normalizeClass(string|array  $name) : string|array

Normalize class name. This is an internal PHPSandbox function.

#### Parameters

string|array | $name | String of the class $name to normalize

#### Returns

string|array —

Returns the normalized class string or an array of normalized strings

#

## Tags

None found

### normalizeInterface()

    normalizeInterface(string|array  $name) : string|array

Normalize interface name. This is an internal PHPSandbox function.

#### Parameters

string|array | $name | String of the interface $name, or array of strings to normalize

#### Returns

string|array —

Returns the normalized interface string or an array of normalized strings

#

## Tags

None found

### normalizeTrait()

    normalizeTrait(string|array  $name) : string|array

Normalize trait name. This is an internal PHPSandbox function.

#### Parameters

string|array | $name | String of the trait $name, or array of strings to normalize

#### Returns

string|array —

Returns the normalized trait string or an array of normalized strings

#

## Tags

None found

### normalizeKeyword()

    normalizeKeyword(string|array  $name) : string|array

Normalize keyword name. This is an internal PHPSandbox function.

#### Parameters

string|array | $name | String of the keyword $name, or array of strings to normalize

#### Returns

string|array —

Returns the normalized keyword string or an array of normalized strings

#

## Tags

None found

### normalizeOperator()

    normalizeOperator(string|array  $name) : string|array

Normalize operator name. This is an internal PHPSandbox function.

#### Parameters

string|array | $name | String of the operator $name, or array of strings to normalize

#### Returns

string|array —

Returns the normalized operator string or an array of normalized strings

#

## Tags

None found

### normalizePrimitive()

    normalizePrimitive(string|array  $name) : string|array

Normalize primitive name. This is an internal PHPSandbox function.

#### Parameters

string|array | $name | String of the primitive $name, or array of strings to normalize

#### Returns

string|array —

Returns the normalized primitive string or an array of normalized strings

#

## Tags

None found

### normalizeType()

    normalizeType(string|array  $name) : string|array

Normalize type name. This is an internal PHPSandbox function.

#### Parameters

string|array | $name | String of the type $name, or array of strings to normalize

#### Returns

string|array —

Returns the normalized type string or an array of normalized strings

#

## Tags

None found

### prepareVars()

    prepareVars() : string

Prepare defined variables for execution

#### Throws

\PHPSandbox\Error

  Throws exception if variable preparation error occurs

#### Returns

string —

Prepared string of variable output

#

## Tags

None found

### prepareConsts()

    prepareConsts()

Prepare defined constants for execution

#

## Tags

None found

### prepareNamespaces()

    prepareNamespaces()

Prepare defined namespaces for execution

#

## Tags

None found

### prepareAliases()

    prepareAliases()

Prepare defined aliases for execution

#

## Tags

None found

### prepareUses()

    prepareUses()

Prepare defined uses (or aliases) for execution

#

## Tags

alias | prepareAliases();

### disassemble()

    disassemble(callable  $closure) : string

Disassemble callable to string

#### Parameters

callable | $closure | The callable to disassemble

#### Throws

\PHPSandbox\Error

  Throw exception if callable is passed and FunctionParser library is missing

#### Returns

string —

Return the disassembled code string

#

## Tags

None found

### autoWhitelist()

    autoWhitelist(string  $code, boolean  $appended = false) : mixed

Automatically whitelisted trusted code

#### Parameters

string | $code | String of trusted $code to automatically whitelist
boolean | $appended | Flag if this code ir prended or appended (true = appended)

#### Throws

\PHPSandbox\Error

  Throw exception if code cannot be parsed for whitelisting

#### Returns

mixed —

Return result of error handler if $code could not be parsed

#

## Tags

None found

### autoDefine()

    autoDefine(\FunctionParser\FunctionParser  $disassembled_closure)

Automatically define variables passed to disassembled closure

#### Parameters

\FunctionParser\FunctionParser | $disassembled_closure |

#

## Tags

None found

### PHPSandbox.php