title: How to clone an array of objects in PHP?
body: <p>I have an array of objects. I know that objects get assigned by "reference" and arrays by "value". But when I assign the array, each element of the array is referencing the object, so when I modify an object in either array the changes are reflected in the other.</p>
  
  <p>Is there a simple way to clone an array, or must I loop through it to clone each object?</p>