diff --git a/language/predefined/arrayaccess.xml b/language/predefined/arrayaccess.xml index a54cf6ff67..d64b13e02b 100644 --- a/language/predefined/arrayaccess.xml +++ b/language/predefined/arrayaccess.xml @@ -45,8 +45,9 @@ container = array( "one" => 1, @@ -54,6 +55,7 @@ class obj implements arrayaccess { "three" => 3, ); } + public function offsetSet($offset, $value) { if (is_null($offset)) { $this->container[] = $value; @@ -61,12 +63,15 @@ class obj implements arrayaccess { $this->container[$offset] = $value; } } + public function offsetExists($offset) { return isset($this->container[$offset]); } + public function offsetUnset($offset) { unset($this->container[$offset]); } + public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; }