3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Zillow { private static $instance = null; public static function get_instance() { if ( null == self::$instance ) { self::$instance = new self; } return self::$instance; } // end get_instance; private function __construct() { } // end constructor public static function sort($data=array()) { array_multisort( array_column($data, 'rent'), SORT_ASC, SORT_NUMERIC, array_column($data, 'street'), SORT_ASC, SORT_NATURAL, array_column($data, 'unit'), SORT_DESC, SORT_REGULAR, $data ); return $data; } // end array_orderby } // end class // Sample array() $data = array(); $data[] = array('id' => 1, 'number' => '130', 'street' => 'Battery St', 'unit' => '1', 'rent' => 1200); $data[] = array('id' => 1, 'number' => '130', 'street' => 'Battery St', 'unit' => '3', 'rent' => 1800); $data[] = array('id' => 1, 'number' => '1049', 'street' => 'Leavenworth St', 'unit' => '11', 'rent' => 800); $data[] = array('id' => 1, 'number' => '130', 'street' => 'Battery St', 'unit' => '10', 'rent' => 3400); $data[] = array('id' => 1, 'number' => '1059', 'street' => 'Leavenworth St', 'unit' => '10', 'rent' => 1450); $data[] = array('id' => 1, 'number' => '130', 'street' => 'Battery St', 'unit' => '5', 'rent' => 1000); $zillow = Zillow::get_instance(); $printed_data = $zillow->sort($data); echo '<pre>'; var_dump($printed_data); echo '</pre>';

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.3.10.0070.00716.22
7.3.00.0060.00616.59
7.2.130.0150.00016.98
7.2.120.0080.00416.88
7.2.110.0000.01516.86
7.2.100.0040.00716.81
7.2.90.0060.00616.97
7.2.80.0030.00916.79
7.2.70.0000.01316.79
7.2.60.0100.00316.96
7.2.50.0030.00616.63
7.2.40.0000.01416.99
7.2.30.0030.01217.14
7.2.20.0090.00316.96
7.2.10.0080.00416.98
7.2.00.0050.00718.06
7.1.250.0000.01315.51
7.1.200.0070.00715.55
7.1.100.0090.00318.13
7.1.70.0040.00817.21
7.1.60.0180.00935.09
7.1.50.0150.00934.72
7.1.40.0190.00634.39
7.1.30.0160.01034.46
7.1.20.0150.01234.61
7.1.10.0000.01316.57
7.1.00.0120.00016.56
7.0.200.0000.01116.98
7.0.190.0030.00816.48
7.0.180.0060.01016.26
7.0.170.0130.00016.36
7.0.160.0000.01316.18
7.0.150.0030.01016.19
7.0.140.0060.00616.44
7.0.130.0060.00616.66
7.0.120.0060.00616.43
7.0.110.0000.01216.28
7.0.100.0110.00416.49
7.0.90.0000.01216.37
7.0.80.0000.01416.29
7.0.70.0030.00916.27
7.0.60.0020.01016.17
7.0.50.0060.00616.30
7.0.40.0070.00416.40
7.0.30.0060.00616.52
7.0.20.0030.01316.63
7.0.10.0040.00916.35
7.0.00.0040.00816.35
hhvm-3.15.40.0470.14087.12
5.6.300.0100.06120.75
5.6.290.0070.05820.73
5.6.280.0070.05920.80
5.6.270.0060.05820.77
5.6.260.0140.04820.78
5.6.250.0100.05720.86
5.6.240.0130.05520.76
5.6.230.0100.06120.96
5.6.220.0110.05620.94
5.6.210.0110.05520.95
5.6.200.0030.06320.70
5.6.190.0030.06520.72
5.6.180.0140.05120.89
5.6.170.0130.05120.73
5.6.160.0200.04820.70
5.6.150.0060.05820.73
5.6.140.0200.04420.73
5.6.130.0030.05720.75
5.6.120.0140.05120.72
5.6.110.0170.04820.75
5.6.100.0100.05720.81
5.6.90.0100.06220.74
5.6.80.0120.05320.18
5.6.70.0100.05620.29
5.6.60.0070.06020.29
5.6.50.0030.05820.11
5.6.40.0130.04820.09
5.6.30.0030.06220.29
5.6.20.0040.05820.18
5.6.10.0030.05620.18
5.6.00.0130.04820.25