3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['report_date' => 'date', 'name' => 'name'], ['report_date' => 'date', 'color' => 'color'] ]; $result = []; foreach ($array as $row) { $result[$row['report_date']] = ($result[$row['report_date']] ?? []) + $row; } var_export(array_values($result));

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
158.76 ms | 1606 KiB | 10 Q