From dac44789165076f0681f0f3403a80c57a4c99b4c Mon Sep 17 00:00:00 2001 From: Maciej Sobaczewski Date: Sat, 18 Oct 2014 16:56:53 +0000 Subject: [PATCH] Adhere to PEAR Coding Standards' best practices Doesn't fix any bug but makes example consistent with the rest of the manual and consistent git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@335080 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/predefined/arrayaccess.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; }