array, $offset); } public function offsetGet($offset) { return $this->array[$offset]; } public function offsetSet($offset, $value) { if (is_null($offset)) { $this->array[] = $value; } else { $this->array[$offset] = $value; } } public function offsetUnset($offset) { unset($this->array[$offset]); } } $test = new PHPArray; $test[] = 'Hello'; $test[] = ' World!'; print $test[0] . $test[1]; ?>