3v4l.org

run code in 300+ PHP versions simultaneously
<?php function createMultiKeyCmpFunc($cmp, $key /* , keys... */) { $keys = func_get_args(); array_shift($keys); return function (array $a, array $b) use ($cmp, $keys) { return array_reduce($keys, function ($result, $key) use ($cmp, $a, $b) { return $result ?: call_user_func($cmp, $a[$key], $b[$key]); }); }; } $array = [ ['foo' => 4, 'bar' => 2, 'baz' => 3], ['foo' => 4, 'bar' => 3, 'baz' => 3], ['foo' => 3, 'bar' => 2, 'baz' => 3], ['foo' => 4, 'bar' => 1, 'baz' => 6], ['foo' => 3, 'bar' => 2, 'baz' => 3], ['foo' => 1, 'bar' => 4, 'baz' => 3], ['foo' => 2, 'bar' => 2, 'baz' => 1], ['foo' => 6, 'bar' => 6, 'baz' => 8], ['foo' => 6, 'bar' => 2, 'baz' => 3], ['foo' => 3, 'bar' => 1, 'baz' => 5], ['foo' => 4, 'bar' => 2, 'baz' => 3], ]; usort($array, createMultiKeyCmpFunc('strcmp', 'foo', 'bar', 'baz')); var_dump($array);

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.60.0110.00718.54
8.3.50.0050.01322.05
8.3.40.0040.01218.74
8.3.30.0070.00719.22
8.3.20.0000.00720.34
8.3.10.0040.00422.10
8.3.00.0080.00022.46
8.2.180.0040.01118.29
8.2.170.0070.00722.96
8.2.160.0040.01120.94
8.2.150.0030.00524.18
8.2.140.0090.00024.66
8.2.130.0030.00526.16
8.2.120.0040.00419.36
8.2.110.0060.00321.97
8.2.100.0030.01019.57
8.2.90.0000.00819.36
8.2.80.0030.00518.05
8.2.70.0040.00417.75
8.2.60.0050.00317.93
8.2.50.0040.00418.07
8.2.40.0030.00618.28
8.2.30.0040.00418.06
8.2.20.0040.00417.61
8.2.10.0060.00317.82
8.2.00.0060.00317.77
8.1.280.0150.00625.92
8.1.270.0040.00422.15
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00323.80
8.1.230.0120.00019.14
8.1.220.0060.00317.79
8.1.210.0050.00318.77
8.1.200.0100.00017.35
8.1.190.0030.00617.53
8.1.180.0030.00518.73
8.1.170.0040.00418.65
8.1.160.0030.00521.93
8.1.150.0080.00018.57
8.1.140.0000.00917.45
8.1.130.0080.00017.80
8.1.120.0070.00017.45
8.1.110.0000.00817.46
8.1.100.0070.00017.47
8.1.90.0070.00017.38
8.1.80.0070.00017.38
8.1.70.0040.00417.43
8.1.60.0060.00317.59
8.1.50.0080.00017.49
8.1.40.0000.00817.46
8.1.30.0080.00017.62
8.1.20.0040.00417.57
8.1.10.0040.00417.59
8.1.00.0030.00517.48
8.0.300.0080.00018.77
8.0.290.0040.00417.16
8.0.280.0040.00418.36
8.0.270.0030.00317.30
8.0.260.0030.00316.89
8.0.250.0030.00317.02
8.0.240.0040.00417.08
8.0.230.0000.00717.06
8.0.220.0040.00417.00
8.0.210.0030.00316.89
8.0.200.0000.00716.85
8.0.190.0000.00816.96
8.0.180.0030.00616.91
8.0.170.0030.00616.91
8.0.160.0080.00016.88
8.0.150.0060.00316.79
8.0.140.0000.00716.88
8.0.130.0060.00313.34
8.0.120.0020.00516.91
8.0.110.0050.00216.95
8.0.100.0040.00416.94
8.0.90.0040.00416.80
8.0.80.0090.00916.82
8.0.70.0040.00416.90
8.0.60.0040.00416.89
8.0.50.0070.00016.93
8.0.30.0090.01217.25
8.0.20.0120.01217.40
8.0.10.0050.00317.07
8.0.00.0190.00516.85
7.4.330.0030.00215.11
7.4.320.0040.00416.60
7.4.300.0030.00316.43
7.4.290.0000.00816.50
7.4.280.0000.00716.57
7.4.270.0070.00016.58
7.4.260.0040.00416.61
7.4.250.0000.00716.61
7.4.240.0000.00816.62
7.4.230.0000.00716.48
7.4.220.0150.00916.63
7.4.210.0100.00716.60
7.4.200.0070.00016.70
7.4.190.0040.00416.73
7.4.160.0040.01416.33
7.4.150.0160.00617.40
7.4.140.0170.01217.86
7.4.130.0110.01016.53
7.4.120.0080.01216.37
7.4.110.0120.01216.39
7.4.100.0140.00716.54
7.4.90.0110.01116.50
7.4.80.0100.01019.39
7.4.70.0080.01116.42
7.4.60.0120.00916.52
7.4.50.0000.00916.38
7.4.40.0030.01522.77
7.4.30.0100.00716.37
7.4.00.0090.00614.90
7.3.330.0000.00613.20
7.3.320.0000.00513.30
7.3.310.0070.00016.25
7.3.300.0000.00616.40
7.3.290.0120.00916.41
7.3.280.0070.00816.36
7.3.270.0100.00717.40
7.3.260.0120.00716.43
7.3.250.0100.00816.48
7.3.240.0090.00916.46
7.3.230.0180.00916.39
7.3.210.0030.01616.51
7.3.200.0090.01019.39
7.3.190.0100.01016.70
7.3.180.0070.01016.56
7.3.170.0100.01416.56
7.3.160.0070.01016.35
7.3.120.0040.01215.13
7.3.10.0100.00016.90
7.3.00.0080.00816.69
7.2.330.0150.00616.63
7.2.320.0090.00916.80
7.2.310.0080.01116.30
7.2.300.0120.00816.46
7.2.290.0130.00316.71
7.2.130.0000.01316.79
7.2.120.0060.00916.71
7.2.110.0090.00616.96
7.2.100.0100.00016.96
7.2.90.0100.00716.91
7.2.80.0040.01116.98
7.2.70.0080.00816.99
7.2.60.0060.00316.88
7.2.50.0140.00317.00
7.2.40.0030.01016.84
7.2.30.0040.01116.95
7.2.20.0060.00916.96
7.2.10.0000.01316.64
7.2.00.0030.00817.92
7.1.250.0070.00615.86
7.1.70.0030.00617.19
7.1.60.0040.00817.19
7.1.50.0090.01517.09
7.1.00.0030.07722.46
7.0.200.0160.00616.56
7.0.140.0100.06722.07
7.0.60.0030.07720.05
7.0.50.0100.08317.99
7.0.40.0030.05720.14
7.0.30.0270.07720.42
7.0.20.0230.06720.10
7.0.10.0300.07720.23
7.0.00.0130.08720.16
5.6.280.0030.07321.11
5.6.210.0100.07720.77
5.6.200.0100.06318.18
5.6.190.0030.04320.48
5.6.180.0270.05320.46
5.6.170.0300.07320.47
5.6.160.0000.09320.50
5.6.150.0100.04718.26
5.6.140.0100.06318.21
5.6.130.0070.08018.14
5.6.120.0070.08721.13
5.6.110.0070.04021.02
5.6.100.0030.04721.03
5.6.90.0130.06721.12
5.6.80.0130.03720.53
5.6.70.3130.04020.38
5.5.350.0170.04320.37
5.5.340.0100.07018.09
5.5.330.0100.07020.18
5.5.320.0030.04320.43
5.5.310.0330.06720.36
5.5.300.0030.08718.08
5.5.290.0000.05317.98
5.5.280.0070.05720.66
5.5.270.0070.06320.73
5.5.260.0100.08320.78
5.5.250.0170.07720.70
5.5.240.0070.06320.28
5.4.450.0230.05319.47
5.4.440.0130.06019.40
5.4.430.0100.05719.26
5.4.420.0130.05019.63
5.4.410.0130.05018.97
5.4.400.0170.06318.78
5.4.390.0300.05018.48
5.4.380.0200.07018.64
5.4.370.0100.04718.46
5.4.360.0130.03318.69
5.4.350.0040.04012.03
5.4.340.0060.03612.02
5.4.320.0060.04212.52
5.4.310.0030.04512.52
5.4.300.0050.04512.51
5.4.290.0040.04112.51
5.4.280.0040.04312.41
5.4.270.0090.04812.41
5.4.260.0200.05318.96
5.4.250.0300.05718.95
5.4.240.0270.07018.95
5.4.230.0130.05718.94
5.4.220.0100.07019.06
5.4.210.0100.07018.91
5.4.200.0100.07318.78
5.4.190.0230.06718.76
5.4.180.0230.05018.96
5.4.170.0200.07018.87
5.4.160.0130.06319.01
5.4.150.0200.06718.81
5.4.140.0200.05316.45
5.4.130.0070.06016.69
5.4.120.0170.04716.36
5.4.110.0130.07716.46
5.4.100.0070.07716.47
5.4.90.0100.07316.62
5.4.80.0100.06316.46
5.4.70.0000.07016.44
5.4.60.0130.06016.52
5.4.50.0100.06016.45
5.4.40.0030.07716.35
5.4.30.0170.04716.38
5.4.20.0230.06016.34
5.4.10.0130.05716.38
5.4.00.0130.06015.88
5.3.290.0080.05712.80
5.3.280.0070.06314.60
5.3.270.0130.06014.66
5.3.260.0170.07314.61
5.3.250.0170.05314.69
5.3.240.0170.06714.80
5.3.230.0200.04714.63
5.3.220.0100.07714.75
5.3.210.0130.07314.65
5.3.200.0170.06014.56
5.3.190.0030.08714.61
5.3.180.0230.06014.57
5.3.170.0070.07014.74
5.3.160.0170.06014.75
5.3.150.0130.06314.41
5.3.140.0100.07314.60
5.3.130.0130.07314.63
5.3.120.0130.07314.59
5.3.110.0100.05714.55
5.3.100.0000.07714.13
5.3.90.0200.05014.25
5.3.80.0130.07014.02
5.3.70.0130.06014.10
5.3.60.0170.06314.10
5.3.50.0070.06314.19
5.3.40.0130.05314.04
5.3.30.0100.06014.01
5.3.20.0100.06713.79
5.3.10.0170.06013.67
5.3.00.0200.05313.65
5.2.170.0100.05311.13
5.2.160.0100.05011.21
5.2.150.0100.05011.36
5.2.140.0170.05011.12
5.2.130.0070.05711.18
5.2.120.0170.04011.15
5.2.110.0100.06011.18
5.2.100.0130.05711.07
5.2.90.0100.05010.93
5.2.80.0100.04311.17
5.2.70.0100.05310.92
5.2.60.0100.05011.22
5.2.50.0030.07311.11
5.2.40.0030.05311.16
5.2.30.0100.04710.87
5.2.20.0100.04011.04
5.2.10.0130.05010.76
5.2.00.0030.05310.68
5.1.60.0100.04710.09
5.1.50.0130.03710.23
5.1.40.0170.0379.97
5.1.30.0070.05010.41
5.1.20.0030.05310.57
5.1.10.0070.03310.09
5.1.00.0070.04310.07
5.0.50.0030.0308.70
5.0.40.0070.0278.38
5.0.30.0030.0478.37
5.0.20.0070.0378.43
5.0.10.0100.0238.16
5.0.00.0070.0408.36
4.4.90.0170.0177.54
4.4.80.0070.0277.54
4.4.70.0030.0237.54
4.4.60.0000.0277.54
4.4.50.0000.0237.54
4.4.40.0030.0477.54
4.4.30.0030.0307.54
4.4.20.0100.0237.54
4.4.10.0030.0277.54
4.4.00.0070.0307.54
4.3.110.0030.0277.54
4.3.100.0000.0277.54
4.3.90.0000.0277.54
4.3.80.0070.0407.54
4.3.70.0030.0237.54
4.3.60.0000.0337.54
4.3.50.0030.0277.54
4.3.40.0070.0437.54
4.3.30.0030.0237.54
4.3.20.0000.0237.54
4.3.10.0000.0277.54
4.3.00.0230.01713.28

preferences:
48 ms | 401 KiB | 5 Q