Why is array_filter returning a reference?
I would like to understand the difference between these two ( $bookingRows is an array of objects with different properties). $vehicleRows = []; foreach($bookingRows as $row) { if($row->GroupCode == ‘F’) { $vehicleRows[] = clone $row; } } and $vehicleRows = array_values( array_filter($bookingRows, function ($row) { return $row->GroupCode == ‘F’; }) ); My problem is that… Read More Why is array_filter returning a reference?