-
-
Notifications
You must be signed in to change notification settings - Fork 3
Description
A correct array implementation should also implement Iterator
or IteratorAggregate
.
https://www.php.net/manual/en/class.iterator.php
https://www.php.net/manual/en/class.iteratoraggregate.php
I had to add to implement Iterator
it into the Session
class so it could be used with slim/csrf
for example. The lib normally operates on $_SESSION
but you can substitute it for a custom array. It checks for ArrayAccess, Countable, Iterator
. Its possible that slim/csrf
should instead extend the Traversable
interface because only checking for Iterator
means IteratorAggregate
implementations would not work. I'll have to look into it if PHP considers these to be magically the same.
There's also Serializable
which I think could be needed by some libraries.
https://www.php.net/manual/en/class.serializable.php
I can continue working on this.
Sorry for raising these issues 😅