3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 495 => (object)['date' => '2009-10-31 18:24:09'], 582 => (object)['date' => '2010-2-11 12:01:42'], 121 => (object)['date' => '2008-12-1 18:24:09'], 333 => (object)['date' => '2019-9-9 15:15:15'], 987 => (object)['date' => '2009-2-20 6:06:33'], ]; uasort( $array, function($a, $b) { echo "compare\n"; return strtotime($a->date) <=> strtotime($b->date); } ); var_export($array); echo "\n---\n"; $array = [ 495 => (object)['date' => '2009-10-31 18:24:09'], 582 => (object)['date' => '2010-2-11 12:01:42'], 121 => (object)['date' => '2008-12-1 18:24:09'], 333 => (object)['date' => '2019-9-9 15:15:15'], 987 => (object)['date' => '2009-2-20 6:06:33'], ]; $dates = array_map('strtotime', array_column($array, 'date')); array_multisort($dates, $array); var_export($array);
Output for git.master, git.master_jit, rfc.property-hooks
compare compare compare compare compare compare compare compare array ( 121 => (object) array( 'date' => '2008-12-1 18:24:09', ), 987 => (object) array( 'date' => '2009-2-20 6:06:33', ), 495 => (object) array( 'date' => '2009-10-31 18:24:09', ), 582 => (object) array( 'date' => '2010-2-11 12:01:42', ), 333 => (object) array( 'date' => '2019-9-9 15:15:15', ), ) --- array ( 0 => (object) array( 'date' => '2008-12-1 18:24:09', ), 1 => (object) array( 'date' => '2009-2-20 6:06:33', ), 2 => (object) array( 'date' => '2009-10-31 18:24:09', ), 3 => (object) array( 'date' => '2010-2-11 12:01:42', ), 4 => (object) array( 'date' => '2019-9-9 15:15:15', ), )

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:
59.1 ms | 403 KiB | 8 Q