I want to implement an object that behaves like an array. It should be used as follows:
$var = new CustomCollection(retrieveFromWebService());
echo $var[0];
$var[0] = 'a';
Can this be done in PHP using magic methods or another mechanism?
source
share