This code:
$a = new MyObject();
$b = &$a;
will make $b point to $a and not the instance itself.
This becomes a problem when you do like this:
$a = new MyObject();
$b = &$a;
$a = new AnotherObject();
In this case, $b will be refering to the instace of AnotherObject. This is NOT the way I want it to work.
In C you can write like this:
void a;
void b;
a = malloc(sizeof(MyStruct));
b = a; // they point toward the same space in memory
a = malloc(sizeof(AnotherStruct));
in this case b is still pointing toward the allocated MyStruct structure. Can I reproduce this in PHP??