3v4l.org

run code in 300+ PHP versions simultaneously
<?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).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.70.0100.00716.88
8.3.60.0090.00618.29
8.3.50.0120.00516.50
8.3.40.0000.01518.65
8.3.30.0120.00318.75
8.3.20.0060.00320.34
8.3.10.0080.00021.89
8.3.00.0040.00417.78
8.2.180.0140.00418.16
8.2.170.0150.00022.96
8.2.160.0130.00320.52
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0040.00420.70
8.2.110.0030.00722.27
8.2.100.0060.00618.15
8.2.90.0000.00918.16
8.2.80.0030.00618.05
8.2.70.0000.00918.03
8.2.60.0000.00818.16
8.2.50.0070.00418.10
8.2.40.0040.00420.59
8.2.30.0080.00019.19
8.2.20.0040.00418.13
8.2.10.0040.00418.22
8.2.00.0030.00618.07
8.1.280.0140.00425.92
8.1.270.0000.00823.57
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0120.00622.22
8.1.230.0090.00320.97
8.1.220.0080.00017.74
8.1.210.0030.00618.77
8.1.200.0060.00317.48
8.1.190.0060.00317.35
8.1.180.0000.00818.10
8.1.170.0040.00418.81
8.1.160.0040.00419.04
8.1.150.0040.00420.71
8.1.140.0000.00819.56
8.1.130.0000.00718.96
8.1.120.0030.00517.38
8.1.110.0030.00517.36
8.1.100.0040.00417.45
8.1.90.0110.00017.52
8.1.80.0040.00417.48
8.1.70.0030.00517.49
8.1.60.0030.00517.64
8.1.50.0030.00517.52
8.1.40.0050.00317.59
8.1.30.0080.00017.70
8.1.20.0080.00017.71
8.1.10.0090.00017.50
8.1.00.0050.00317.43
8.0.300.0030.00619.68
8.0.290.0080.00016.75
8.0.280.0000.00718.45
8.0.270.0080.00017.18
8.0.260.0070.00018.38
8.0.250.0030.00317.04
8.0.240.0070.00016.98
8.0.230.0050.00316.98
8.0.220.0070.00016.82
8.0.210.0020.00516.88
8.0.200.0070.00016.96
8.0.190.0060.00316.95
8.0.180.0030.00516.92
8.0.170.0040.00416.90
8.0.160.0030.00516.95
8.0.150.0000.00716.88
8.0.140.0050.00316.76
8.0.130.0030.00313.34
8.0.120.0040.00416.84
8.0.110.0050.00216.87
8.0.100.0040.00416.93
8.0.90.0000.00716.89
8.0.80.0130.01316.88
8.0.70.0050.00316.86
8.0.60.0070.00016.88
8.0.50.0080.00016.81
8.0.30.0090.01017.21
8.0.20.0130.00717.40
8.0.10.0040.00416.94
8.0.00.0160.00316.86
7.4.330.0050.00015.55
7.4.320.0040.00416.65
7.4.300.0000.00716.57
7.4.290.0050.00516.45
7.4.280.0000.00716.52
7.4.270.0000.00716.68
7.4.260.0050.00316.66
7.4.250.0030.00316.45
7.4.240.0000.00716.54
7.4.230.0000.00716.64
7.4.220.0170.01016.48
7.4.210.0110.00916.54
7.4.200.0000.00716.73
7.4.160.0080.01516.57
7.4.150.0110.00717.40
7.4.140.0110.01217.86
7.4.130.0230.00416.60
7.4.120.0080.01516.64
7.4.110.0090.00916.71
7.4.100.0120.00616.61
7.4.90.0160.00316.46
7.4.80.0160.00319.39
7.4.70.0130.00616.68
7.4.60.0030.01416.49
7.4.50.0050.01016.59
7.4.40.0120.00816.36
7.4.30.0100.01116.57
7.4.00.0070.01014.95
7.3.330.0000.00713.08
7.3.320.0000.00513.26
7.3.310.0080.00016.11
7.3.300.0050.00216.30
7.3.290.0040.00416.19
7.3.280.0090.00916.29
7.3.270.0090.00917.40
7.3.260.0150.00916.57
7.3.250.0140.00516.49
7.3.240.0080.01216.51
7.3.230.0090.00916.61
7.3.210.0090.00916.22
7.3.200.0140.00316.62
7.3.190.0120.00416.56
7.3.180.0070.01016.16
7.3.170.0070.01016.46
7.3.160.0000.01816.52
7.3.10.0070.00716.22
7.3.00.0060.00616.59
7.2.330.0140.00416.75
7.2.320.0070.01116.86
7.2.310.0030.01516.77
7.2.300.0130.00616.44
7.2.290.0090.01516.52
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

preferences:
38.8 ms | 401 KiB | 5 Q