3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrDates = array( "12/25/2009","01/10/2008","02/12/2000","03/17/1948", "03/06/1948","11/25/1972","10/23/2009","01/14/2008", "02/22/2000","03/27/1948","03/16/1948","11/24/1972", "11/13/2009","11/10/2008","12/12/2000","05/17/1948", "05/06/1948","10/25/1972","09/23/2009","02/14/2008", "03/22/2000","04/27/1948","04/16/1948","08/24/1972" ); /** * better_cmp() * @param int $a * @param int $b * date comparison callback **/ function better_cmp($a,$b){ list($a,$b) = [strtotime($a), strtotime($b)]; return ($a <=> $b); } usort($arrDates,"better_cmp"); print_r($arrDates);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => 03/06/1948 [1] => 03/16/1948 [2] => 03/17/1948 [3] => 03/27/1948 [4] => 04/16/1948 [5] => 04/27/1948 [6] => 05/06/1948 [7] => 05/17/1948 [8] => 08/24/1972 [9] => 10/25/1972 [10] => 11/24/1972 [11] => 11/25/1972 [12] => 02/12/2000 [13] => 02/22/2000 [14] => 03/22/2000 [15] => 12/12/2000 [16] => 01/10/2008 [17] => 01/14/2008 [18] => 02/14/2008 [19] => 11/10/2008 [20] => 09/23/2009 [21] => 10/23/2009 [22] => 11/13/2009 [23] => 12/25/2009 )

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:
35.5 ms | 402 KiB | 8 Q