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
It just makes a completely new object, which retains the properties of the object being copied. It performs a deep copy:
$assigned = $instance;
It makes a shallow copy when you copy an object from one to another:
$assigned = clone $instance;