I know this is covered in the php docs but I got confused with this issue .
From the php docs :
$instance = new SimpleClass(); $assigned = $ins
$assigned = $instance
Above will assign $instance to $assigned, the most basic assign.
$assigned = clone $instance
This is for object clone. Assign a copy of object $instance to $assigned.
Without clone, $assigned and $instance has same object id, which means they are pointing to same object.