As jorge dot villalobos at gmail dot com pointed out, the "__clone is NOT an override".
However, if one needs a true copy of an object (which has real copies of all subobjects too, not references), one can define a class method such as this to the object-to-be-cloned:
public function copy()
{
$serialized_contents = serialize($this);
return unserialize($serialized_contents);
}
The method makes a string representation of the object's contents (including subobjects), which can then be unserialized back to an object.
The method usage is simple:
$original_object = new MyCloneable(); //can have sub objects
$copied_object = $original_object->clone(); //only makes copies of the values, not references
With serialization, you surely don't have to worry about references, since serialized object is just simple text.