The ArrayAccess interfaceIntroductionInterface to provide accessing objects as arrays. Interface synopsis
ArrayAccess
/* Methods */
public bool ArrayAccess::offsetExists(mixed
$offset )public mixed ArrayAccess::offsetGet(mixed
$offset )public void ArrayAccess::offsetSet(mixed
$offset , mixed $value )public void ArrayAccess::offsetUnset(mixed
$offset )ExamplesExample #1 Basic usage
The above example will output something similar to: bool(true) int(2) bool(false) string(7) "A value" obj Object ( [container:obj:private] => Array ( [one] => 1 [three] => 3 [two] => A value [0] => Append 1 [1] => Append 2 [2] => Append 3 ) )
|