PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

ArrayObject::offsetSet> <ArrayObject::offsetExists
Last updated: Fri, 22 Aug 2008

view this page in

ArrayObject::offsetGet

(PHP 5)

ArrayObject::offsetGetRetorna o valor do índice especificado

Descrição

mixed ArrayObject::offsetGet ( mixed $index )
Aviso

Esta função não está documentada; somente a lista de argumentos está disponível.

Parâmetros

index

O índice com o valor.

Valor Retornado

O valor no especificado $index.



add a note add a note User Contributed Notes
ArrayObject::offsetGet
Sam
30-Nov-2007 12:01
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::offsetSet> <ArrayObject::offsetExists
Last updated: Fri, 22 Aug 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites