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 :
$newArray = $this->ContentArray;
var_dump(newArray[0]->text); //print "text"
var_dump($this->ContentArray[0]->text); //print "text"
$this->ContentArray[0]->text = "edit text";
var_dump(newArray[0]->text); //print edit text"
how can I remove the reference to the objects?
$this-ContentArray[0]->text = "edit text";must be$this->ContentArray[0]->text = "edit text";