If you want to use array functions on an ArrayObject, why not use iterator_to_array() to get a standard PHP array? Do your operations on that array, then instantiate a new ArrayObject, passing it the array.
This might be a little slow on large ArrayObjects, but you'd have access to all of the array functions.
The ArrayObject class
Introduction
...
Class synopsis
ArrayObject
ArrayObject
implements
IteratorAggregate
,
Traversable
,
ArrayAccess
,
Countable
{
/* Methods */
ArrayObject::__construct
( mixed $input
)
}Table of Contents
- ArrayObject::append — Appends the value
- ArrayObject::__construct — Construct a new array object
- ArrayObject::count — Get the number of elements in the Iterator
- ArrayObject::getIterator — Create a new iterator from an ArrayObject instance
- ArrayObject::offsetExists — Returns whether the requested $index exists
- ArrayObject::offsetGet — Returns the value at the specified $index
- ArrayObject::offsetSet — Sets the value at the specified $index to $newval
- ArrayObject::offsetUnset — Unsets the value at the specified $index
ArrayObject
dave at csixty4 dot com
05-Sep-2008 11:28
05-Sep-2008 11:28
Anonymous
09-Aug-2008 09:17
09-Aug-2008 09:17
Too bad the Array functions [1] are not available on this object… otherwise I would be using it all the time.
[1] http://nl.php.net/manual/en/ref.array.php
