note 94315 added to class.arrayaccess
| From: | James at osu1 dot php dot net | Date: | Wed, 28 Oct 2009 17:33:52 +0000 |
| Subject: | note 94315 added to class.arrayaccess | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-162201@lists.php.net to get a copy of this message | ||
Might be helpful to someone:
public function offsetSet($offset, $value) {
if (empty($offset)) {
$this->_data[] = $value;
} else {
$this->_data[$offset] = $value;
}
}
Allows use of $arrayObject[] = $extraValue; Use with some caution, of course.
----
Server IP: 92.48.74.199
Probable Submitter: 84.12.140.56
----
Manual Page -- http://www.php.net/manual/en/class.arrayaccess.php
Edit -- https://master.php.net/note/edit/94315
Del: integrated -- https://master.php.net/note/delete/94315/integrated
Del: useless -- https://master.php.net/note/delete/94315/useless
Del: bad code -- https://master.php.net/note/delete/94315/bad+code
Del: spam -- https://master.php.net/note/delete/94315/spam
Del: non-english -- https://master.php.net/note/delete/94315/non-english
Del: in docs -- https://master.php.net/note/delete/94315/in+docs
Del: other reasons-- https://master.php.net/note/delete/94315
Reject -- https://master.php.net/note/reject/94315
Search -- https://master.php.net/manage/user-notes.php