note 114040 deleted from arrayobject.offsetget by tularis
| From: | tularis@php.net | Date: | Sun, 05 Jan 2014 16:21:00 +0000 |
| Subject: | note 114040 deleted from arrayobject.offsetget by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-198111@lists.php.net to get a copy of this message | ||
Note Submitter: a6y at xakep dot ru
----
Try this one to overload offsetGet()
class ArrayObjectP4k extends ArrayObject
{
public function offsetGet($offset)
{
// ÐозвÑаÑаем ÑебÑ, еÑди
наÑ
одимÑÑ Ð½Ð° деÑеве,
// или лиÑÑ(Ñ Ñипом), еÑли на
конÑе
// ÐÑполÑзÑем позднее
ÑÑаÑиÑеÑкое ÑвÑзÑвание
// Ð´Ð»Ñ Ð¿ÑевенÑа возвÑаÑа
Ñипа ArrayObject
return $this->offsetExists($offset) ? (is_array(parent::offsetGet($offset)) ? new
static (parent::offsetGet($offset)) : parent::offsetGet($offset)) : null;
}
}