3v4l.org

run code in 300+ PHP versions simultaneously
<?php $officialGrid = [ ['grid' => TRUE, 'time' => '08:00', 'content' => NULL], ['grid' => TRUE, 'time' => '09:00', 'content' => NULL] ]; $bookings = [ ['grid' => NULL, 'time' => '08:00', 'content' => 'Paul Simon'], ['grid' => NULL, 'time' => '08:00', 'content' => 'Art Garfunkel'], ['grid' => NULL, 'time' => '08:39', 'content' => 'Homer J. Simpson'] ]; $timeSlotsToDisplay = $officialGrid; array_map(function($el) use(&$timeSlotsToDisplay, $officialGrid) { $timeSlotsToDisplay[$el['time']] = array( 'content' => (isset($timeSlotsToDisplay[$el['time']]) ? trim($timeSlotsToDisplay[$el['time']]['content'], ',') . ',' : '') . $el['content'], 'grid' => isset($officialGrid[$el['time']]) ? true : null ); }, $bookings); ksort($timeSlotsToDisplay); var_export($timeSlotsToDisplay);

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
151.99 ms | 1651 KiB | 14 Q