Menu

## SandboxedString
in package
implements ArrayAccess, IteratorAggregate

SandboxedString.php : 22

Sandboxed string class for PHP Sandboxes.

This class wraps sandboxed strings to intercept and check callable invocations

##### Tags

namespace

  PHPSandbox

author

  Elijah Horton elijah@corveda.com

version
  3.0

### Interfaces, Classes and Traits

ArrayAccess
IteratorAggregate

### Table of Contents

$sandbox : PHPSandbox
  PHPSandbox instance invoked by the SandboxedString
$value : string
  Value of the SandboxedString
__construct() : mixed
  Constructs the SandboxedString
__invoke() : mixed|null
  Checks the string value against the sandbox function whitelists and blacklists for callback violations
__toString() : string
  Returns the original string value
getIterator() : ArrayIterator
  Return iterator for string value
offsetExists() : bool
  Check if specified offset exists in string value
offsetGet() : string
  Get string value at specified offset
offsetSet() : mixed
  Set string value at specified offset
offsetUnset() : mixed
  Unset string value at specified offset

### Properties

#### $sandbox

SandboxedString.php : 30

PHPSandbox instance invoked by the SandboxedString

`private PHPSandbox $sandbox`

#### $value

SandboxedString.php : 26

Value of the SandboxedString

`private string $value`

### Methods

#### __construct()

SandboxedString.php : 35

Constructs the SandboxedString

`public __construct(string $value, PHPSandbox $sandbox) : mixed`

##### Parameters

$value : string

  Original string value

$sandbox : PHPSandbox

  The current sandbox instance to test against

##### Return values

mixed —

#### __invoke()

SandboxedString.php : 51

Checks the string value against the sandbox function whitelists and blacklists for callback violations

`public __invoke() : mixed|null`

##### Tags

throws
  Throwable

##### Return values

mixed|null —

#### __toString()

SandboxedString.php : 42

Returns the original string value

`public __toString() : string`

##### Return values

string —

#### getIterator()

SandboxedString.php : 99

Return iterator for string value

`public getIterator() : ArrayIterator`

##### Return values

ArrayIterator —

Array iterator to return

#### offsetExists()

SandboxedString.php : 87

Check if specified offset exists in string value

`public offsetExists(mixed $offset) : bool`

##### Parameters

$offset : mixed

  Offset to check

##### Return values

bool —

Return true if offset exists, false otherwise

#### offsetGet()

SandboxedString.php : 79

Get string value at specified offset

`public offsetGet(mixed $offset) : string`

##### Parameters

$offset : mixed

  Offset to get value

##### Return values

string —

Value to return

#### offsetSet()

SandboxedString.php : 67

Set string value at specified offset

`public offsetSet(mixed $offset, mixed $value) : mixed`

##### Parameters

$offset : mixed

  Offset to set value

$value : mixed

  Value to set

##### Return values

mixed —

#### offsetUnset()

SandboxedString.php : 93

Unset string value at specified offset

`public offsetUnset(mixed $offset) : mixed`

##### Parameters

$offset : mixed

  Offset to unset

##### Return values

mixed —

## Search results