Something you should be aware of, if you are cloning objects containing objects: Objects are always passed as reference, so the idea of cloning the object when returning is the first thing to do if you want to avoid changing the value because you are operating on a reference. The issue is that the clone keeps the child references. class test { protected $sub; public function __construct() { $this-