3v4l.org

run code in 300+ PHP versions simultaneously
<?php $itineraries_params = array_reduce(array_map( function ($weekday) { return [ (object) [ 'weekday' => $weekday, 'arrival_time' => '09:00:00', 'from_address_id' => 1, 'to_address_id' => 2 ], (object) [ 'weekday' => $weekday, 'arrival_time' => '17:00:00', 'from_address_id' => 2, 'to_address_id' => 1 ] ]; }, range(1, 5) )); var_dump($itineraries_params); // vrs Ruby // // itineraries_params = (1..5).flat_map do |weekday| // [{ // weekday: weekday, // arrival_time: '09:00:00', // from_address_id: user.home_address.id, // to_address_id: user.work_address.id // }, { // weekday: weekday, // arrival_time: '17:00:00', // from_address_id: user.work_address.id, // to_address_id: user.home_address.id // }] // end
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught ArgumentCountError: array_reduce() expects at least 2 arguments, 1 given in /in/5K9mh:3 Stack trace: #0 /in/5K9mh(3): array_reduce(Array) #1 {main} thrown in /in/5K9mh on line 3
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
56.18 ms | 401 KiB | 8 Q