I have a class called Collection
which stores objects of same type.
Collection
implements array interfaces: Iterator
, ArrayAccess
, SeekableIterator
, and Countable
.
I'd like to pass a Collection
object as the array argument to the array_map
function. But this fails with the error
PHP Warning: array_map(): Argument #2 should be an array
Can I achieve this by implementing other/more interfaces, so that Collection
objects are seen as arrays?