When working with objects in Javascript, I can assign a pointer to a particular object like so:-
myPointer = window.myForm.elements[0];
And then refer to that object using the pointer:
theValue = myPointer.value;
Is there some way to get this kind of behavior with objects in PHP? When I do this:-
$someObj = new MyClass();
$someObj->children[0] = new myClass();
// all OK so far...
// here's where I want to point, rather than assign:-
$myPointer = $someObj->children[0];
$myPointer->children[0] = new MyClass();
Now if I do stuff to $myPointer, it doesn't affect the original object. I understand that this is what is to be expected, but is there there a way around this?
Thanks,
Antun