3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ 'avgvalue' => 0, 'timestamp' => '2011-02-04T11:00:00.000Z', ], [ 'avgvalue' => 268.3, 'timestamp' => '2011-02-04T12:00:00.000Z' ], ]; $result = []; foreach ($array as $row) { $result[substr($row['timestamp'], 0, 10)][] = $row; } var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( '2011-02-04' => array ( 0 => array ( 'avgvalue' => 0, 'timestamp' => '2011-02-04T11:00:00.000Z', ), 1 => array ( 'avgvalue' => 268.3, 'timestamp' => '2011-02-04T12:00:00.000Z', ), ), )

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