3v4l.org

run code in 300+ PHP versions simultaneously
<?php $holiday_array = [ ['employee' => ['id' => 456062], 'num' => 1], ['employee' => ['id' => 522010], 'num' => 1], ['employee' => ['id' => 638070], 'num' => 1], ['employee' => ['id' => 638070], 'num' => 2], ['employee' => ['id' => 351779], 'num' => 1], ['employee' => ['id' => 638070], 'num' => 3], ['employee' => ['id' => 638070], 'num' => 4], ['employee' => ['id' => 351779], 'num' => 2], ['employee' => ['id' => 351779], 'num' => 3], ['employee' => ['id' => 351779], 'num' => 4], ]; $result = []; foreach ($holiday_array as $row) { $result[$row['employee']['id']] = $row; } var_export(array_values($result));
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 'employee' => array ( 'id' => 456062, ), 'num' => 1, ), 1 => array ( 'employee' => array ( 'id' => 522010, ), 'num' => 1, ), 2 => array ( 'employee' => array ( 'id' => 638070, ), 'num' => 4, ), 3 => array ( 'employee' => array ( 'id' => 351779, ), 'num' => 4, ), )

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:
131.39 ms | 406 KiB | 5 Q