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
A pure PHP 7.4 >= solution:
$cloned = array_map(fn ($o) => clone $o, $original);