ArrayAccess Interface is
used to provide accessing objects as arrays.
as the documentation says. but most of array function not working on it. Also the normal object function have problems with this conversion. so what is the idea. so for example
- You can't call 'array_key_exists' on an object of class which implements this interface.
- class can't be iterable unless the new class implements Iterator interface as well.
- You can't assign by reference with the ArrayAccess.(you have to make your own implementation(a custom function to do this).
- Most of functions for arrays Not working on classes implement this interface.
so why we put ourselves in pain if there is no clear reason.