I was tested and I got this wrong but this doesn't make sense:
class myClass
{
public $x;
function myMethod()
{
echo $this->x;
}
}
$a = new myClass();
$a->x = 10;
$b = $a;
$b->x = 20;
$c = clone $b;
$c->x = 30;
$a->myMethod();
$b->myMethod();
$c->myMethod();
My intuition would be 102030 but the result is actually 202030!!! What happened to 10?!?! Shouldn't the variable of $a be left alone? I thought all objects are independent and would not be updated unless it has direct reference set by the ampersand (=&)?