If you're overloading ArrayObject, it's worth noting that while this method (when implemented by the parent) will return a reference, so code like $fakeArray['foobar']['hello'] = 1; will work like you expect.
However, when you overload the offsetGet method, you CANNOT define it as &offsetGet, so the above code falls out (because it returns the 'foobar' variable before you actually work with it).
This is something that the developers broke between 5.0 and 5.1, and was closed as bogus (http://bugs.php.net/bug.php?id=34783). So this is not a big, or question, or request, but just something worth noting.
ArrayObject::offsetGet
(PHP 5)
ArrayObject::offsetGet — Returns the value at the specified $index
Description
Warning
This function is currently not documented; only its argument list is available.
Parameters
- index
-
The index with the value.
Return Values
The value at the specified $index.
ArrayObject::offsetGet
Sam
30-Nov-2007 11:01
30-Nov-2007 11:01
