note 119149 added to arrayobject.offsetget
| From: | Jason | Date: | Mon, 11 Apr 2016 14:43:50 +0000 |
| Subject: | note 119149 added to arrayobject.offsetget | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-205198@lists.php.net to get a copy of this message | ||
It's worth noting that the PHP devs *did* fix the issue brought up in Sam's comment in
2013 (per the comment thread in his link here: https://bugs.php.net/bug.php?id=34783#1366088374),
since at least PHP 5.3.8.
So, you *can* (and in most cases should) overload offsetGet with reference syntax to get expected
functionality:
<?php
class myArrayType extends ArrayAccess {
public function &offsetGet($index) {
// ...
}
}
?>
----
Server IP: 72.52.91.14
Probable Submitter: 172.124.121.137
----
Manual Page -- http://php.net/manual/en/arrayobject.offsetget.php
Edit -- https://master.php.net/note/edit/119149
Del: integrated -- https://master.php.net/note/delete/119149/integrated
Del: useless -- https://master.php.net/note/delete/119149/useless
Del: bad code -- https://master.php.net/note/delete/119149/bad+code
Del: spam -- https://master.php.net/note/delete/119149/spam
Del: non-english -- https://master.php.net/note/delete/119149/non-english
Del: in docs -- https://master.php.net/note/delete/119149/in+docs
Del: other reasons-- https://master.php.net/note/delete/119149
Reject -- https://master.php.net/note/reject/119149
Search -- https://master.php.net/manage/user-notes.php