Arr::clone(array $array): array
$object = new class() {
public $counter = 1;
function __clone()
{
$this->counter = 2;
}
};
$array = [
'foo',
'bar',
$object,
'test',
'nested' => [
'object' => $object
]
];
$cloned = Arr::clone($array);
$cloned[0] -> 'foo'
$cloned[2]->counter -> 2
$cloned['nested']['object']->counter -> 2