2
ZE2 ArrayAccess and ASSIGN_OP operators (+=)
6
class OverloadedArray implements ArrayAccess {
9
function __construct() {
10
$this->realArray = array(1,2,3);
13
function offsetExists($index) {
14
return array_key_exists($this->realArray, $index);
17
function offsetGet($index) {
18
return $this->realArray[$index];
21
function offsetSet($index, $value) {
22
$this->realArray[$index] = $value;
25
function offsetUnset($index) {
26
unset($this->realArray[$index]);
30
$a = new OverloadedArray;