title: Remove object reference from array of objects in PHP
body: <p>Im trying to copy array of objects to a new array. but the reference to the objects in the array are staying the same. my code :</p>
  
  <pre><code>$newArray = $this-&gt;ContentArray;
  var_dump(newArray[0]-&gt;text); //print "text"
  var_dump($this-&gt;ContentArray[0]-&gt;text); //print "text"
  $this-&gt;ContentArray[0]-&gt;text = "edit text"; 
  var_dump(newArray[0]-&gt;text); //print edit text"
  </code></pre>
  
  <p>how can I remove the reference to the objects?</p>