3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(array('date'=>'2014-12-01', 'price'=>'123.00'), array('date'=>'2013-12-01', 'price'=>'123.00'), array('date'=>'2014-02-01', 'price'=>'123.00'), array('date'=>'2014-03-01', 'price'=>'123.00')); var_dump($array); function date_compare($a, $b) { $t1 = strtotime($a[$key]); $t2 = strtotime($b[$key]); return $t1 - $t2; } usort($array, 'date_compare'); var_dump($array);
Output for git.master, git.master_jit, rfc.property-hooks
array(4) { [0]=> array(2) { ["date"]=> string(10) "2014-12-01" ["price"]=> string(6) "123.00" } [1]=> array(2) { ["date"]=> string(10) "2013-12-01" ["price"]=> string(6) "123.00" } [2]=> array(2) { ["date"]=> string(10) "2014-02-01" ["price"]=> string(6) "123.00" } [3]=> array(2) { ["date"]=> string(10) "2014-03-01" ["price"]=> string(6) "123.00" } } Warning: Undefined variable $key in /in/8uk91 on line 8 Warning: Undefined array key "" in /in/8uk91 on line 8 Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /in/8uk91 on line 8 Warning: Undefined variable $key in /in/8uk91 on line 9 Warning: Undefined array key "" in /in/8uk91 on line 9 Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /in/8uk91 on line 9 Warning: Undefined variable $key in /in/8uk91 on line 8 Warning: Undefined array key "" in /in/8uk91 on line 8 Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /in/8uk91 on line 8 Warning: Undefined variable $key in /in/8uk91 on line 9 Warning: Undefined array key "" in /in/8uk91 on line 9 Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /in/8uk91 on line 9 Warning: Undefined variable $key in /in/8uk91 on line 8 Warning: Undefined array key "" in /in/8uk91 on line 8 Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /in/8uk91 on line 8 Warning: Undefined variable $key in /in/8uk91 on line 9 Warning: Undefined array key "" in /in/8uk91 on line 9 Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /in/8uk91 on line 9 array(4) { [0]=> array(2) { ["date"]=> string(10) "2014-12-01" ["price"]=> string(6) "123.00" } [1]=> array(2) { ["date"]=> string(10) "2013-12-01" ["price"]=> string(6) "123.00" } [2]=> array(2) { ["date"]=> string(10) "2014-02-01" ["price"]=> string(6) "123.00" } [3]=> array(2) { ["date"]=> string(10) "2014-03-01" ["price"]=> string(6) "123.00" } }

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.56 ms | 409 KiB | 8 Q