[PHP] ArrayObject - Posibillity to add key = value pair per default?

2009-01-14 Thread Edmund Hertle
Hey, I've just discovered the ArrayObject class, but it seems to not be well documented, so here is my problem: You can use ArrayObject::append() to add a new value to the array, but is there also a method to add a new key and value? And I know that I could extend the class and write my own

Re: [PHP] ArrayObject - Posibillity to add key = value pair per default?

2009-01-14 Thread Edgar da Silva (Fly2k)
Did you try: $a = new ArrayObject; $a['sometest'] = 'somevalue'; ? On Wed, Jan 14, 2009 at 10:42 AM, Edmund Hertle farn...@googlemail.com wrote: Hey, I've just discovered the ArrayObject class, but it seems to not be well documented, so here is my problem: You can use ArrayObject::append()

Re: [PHP] ArrayObject - Posibillity to add key = value pair per default?

2009-01-14 Thread Nathan Nobbe
On Wed, Jan 14, 2009 at 6:18 AM, Edgar da Silva (Fly2k) silva.ed...@gmail.com wrote: Did you try: $a = new ArrayObject; $a['sometest'] = 'somevalue'; its also worth pointing out, the above syntax is available b/c ArrayObject implements the ArrayAccess interface.