3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $format = function($map, $tmp){ $formated = array(); foreach($map as $day => $reg){ $formated[$day][$reg['HORA']] = $reg; } return $formated; }; $result = array_map(array_merge_recursive( array( '2015-01-01' => array(array('HORA' => '0600', 'MOTIVO' => 'teste')), '2015-01-02' => array(array('HORA' => '0600', 'MOTIVO' => 'teste'),array('HORA' => '0700', 'MOTIVO' => 'teste')), '2015-01-03' => array(array('HORA' => '0600', 'MOTIVO' => 'demo')) ), array( '2015-01-01' => array(array('HORA' => '0600', 'MOTIVO' => 'teste')), '2015-01-02' => array(array('HORA' => '0800', 'MOTIVO' => 'teste')), '2015-01-03' => array(array('HORA' => '0800', 'MOTIVO' => 'demo')) ) )); print_r($result);
based on PYc10
Output for 7.0.0 - 7.2.0
Warning: array_map() expects at least 2 parameters, 1 given in /in/knq3d on line 16
Output for 5.3.21 - 5.6.28
Warning: array_map() expects at least 2 parameters, 1 given in /in/knq3d on line 20