Q:

PHP Object-nested data manipulation

I have two classes, A and B, that work together, like this:

Global scope instantiate Aobject.
Aobject instantiate Bobject as a public property.
Bobject contains Carray as a public property.

QUESTION:
How do I manipulate Carray from global scope, without copying it, AND without explicitly pointing at A->B->C for each operation?
PS: This is a minimal example. My chains could end up rather long, if no solution exists.

A:

Use a reference. You will have to use A->B->C only once per scope.
$c = &$A->b->c;
$c['something'] = 'somethiing else';

