Having done a bit of research, I eventually came across the answer to a question I was soon to ask here anyways; How do you work with arrays via the __get
and <
In this particular case, __set
is not actually getting called. If you break down what it happening, it should make a bit more sense:
$tmp = $object->__get('foo');
$tmp['bar'] = 42
If __get
did not return a reference, then instead of assigning 42 to the 'bar' index of the original object, you're be assigning to the 'bar' index of a copy of the original object.