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')); print_r($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.40.0140.00718.83
8.3.30.0140.00319.23
8.3.20.0000.00720.34
8.3.10.0060.00321.93
8.3.00.0000.00822.52
8.2.170.0040.01122.96
8.2.160.0070.00720.93
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00819.36
8.2.110.0040.00420.11
8.2.100.0000.01217.84
8.2.90.0040.00419.35
8.2.80.0000.00818.05
8.2.70.0080.00017.50
8.2.60.0110.00417.91
8.2.50.0030.00618.07
8.2.40.0040.00417.92
8.2.30.0040.00418.11
8.2.20.0070.00017.73
8.2.10.0000.00817.76
8.2.00.0030.00517.64
8.1.270.0040.00422.06
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00623.89
8.1.230.0120.00021.05
8.1.220.0080.00017.74
8.1.210.0030.00518.77
8.1.200.0000.00817.47
8.1.190.0040.00417.66
8.1.180.0050.00318.39
8.1.170.0050.00318.70
8.1.160.0040.00421.95
8.1.150.0040.00418.57
8.1.140.0030.00617.40
8.1.130.0030.00617.73
8.1.120.0000.00717.37
8.1.110.0000.00817.45
8.1.100.0030.00617.37
8.1.90.0040.00417.37
8.1.80.0080.00017.51
8.1.70.0000.00817.42
8.1.60.0050.00317.43
8.1.50.0000.00817.43
8.1.40.0080.00017.36
8.1.30.0000.00817.64
8.1.20.0080.00017.73
8.1.10.0000.00717.52
8.1.00.0060.00317.53
8.0.300.0040.00418.77
8.0.290.0070.00017.17
8.0.280.0070.00018.34
8.0.270.0070.00017.27
8.0.260.0000.00716.88
8.0.250.0000.00716.94
8.0.240.0030.00417.04
8.0.230.0050.00317.03
8.0.220.0050.00317.03
8.0.210.0030.00316.91
8.0.200.0000.00816.95
8.0.190.0000.00916.89
8.0.180.0000.00816.81
8.0.170.0050.00316.83
8.0.160.0000.00716.96
8.0.150.0060.00616.96
8.0.140.0040.00416.83
8.0.130.0060.00313.32
8.0.120.0000.00716.86
8.0.110.0070.00016.84
8.0.100.0000.00716.77
8.0.90.0000.00816.75
8.0.80.0110.00416.90
8.0.70.0000.00716.78
8.0.60.0040.00416.79
8.0.50.0000.00716.79
8.0.30.0080.01117.02
8.0.20.0130.00617.40
8.0.10.0040.00416.82
8.0.00.0120.00816.63
7.4.330.0000.00515.10
7.4.320.0030.00316.50
7.4.300.0030.00316.63
7.4.290.0030.00316.46
7.4.280.0040.00416.61
7.4.270.0000.00716.46
7.4.260.0070.00016.49
7.4.250.0070.00016.54
7.4.240.0000.00816.56
7.4.230.0030.00316.62
7.4.220.0110.00616.36
7.4.210.0040.01316.59
7.4.200.0050.00216.70
7.4.190.0030.00616.42
7.4.160.0090.00616.46
7.4.150.0070.01017.40
7.4.140.0130.01017.86
7.4.130.0130.00816.51
7.4.120.0100.00716.62
7.4.110.0110.00616.43
7.4.100.0100.00616.50
7.4.90.0130.01216.49
7.4.80.0100.00819.39
7.4.70.0090.01216.41
7.4.60.0120.00416.57
7.4.50.0040.00416.47
7.4.40.0070.01022.77
7.4.30.0090.00916.57
7.4.10.0080.00515.06
7.4.00.0100.00615.03
7.3.330.0030.00313.37
7.3.320.0000.00613.39
7.3.310.0030.00316.25
7.3.300.0000.00716.33
7.3.290.0120.00916.39
7.3.280.0050.01316.43
7.3.270.0130.00317.40
7.3.260.0100.00716.45
7.3.250.0120.00516.45
7.3.240.0130.01016.44
7.3.230.0070.01716.39
7.3.210.0060.01016.70
7.3.200.0070.01019.39
7.3.190.0220.00016.35
7.3.180.0080.00816.47
7.3.170.0120.00616.38
7.3.160.0120.00916.64
7.3.130.0070.01015.06
7.3.120.0090.00914.93
7.3.110.0090.01115.05
7.3.100.0100.00314.88
7.3.90.0060.01015.04
7.3.80.0020.01014.95
7.3.70.0020.01115.02
7.3.60.0010.01214.96
7.3.50.0050.01315.04
7.3.40.0050.00914.99
7.3.30.0050.00715.04
7.3.20.0050.00816.60
7.3.10.0090.00416.71
7.3.00.0030.00916.54
7.2.330.0110.00816.43
7.2.320.0090.00916.73
7.2.310.0070.01016.29
7.2.300.0190.00016.52
7.2.290.0060.00916.49
7.2.260.0060.01214.98
7.2.250.0070.01315.13
7.2.240.0070.00815.10
7.2.230.0080.00814.92
7.2.220.0030.00815.28
7.2.210.0060.00915.11
7.2.200.0080.00515.03
7.2.190.0060.00715.06
7.2.180.0070.00514.92
7.2.170.0030.00915.12
7.2.160.0030.01115.15
7.2.150.0030.00916.99
7.2.140.0060.00316.84
7.2.130.0060.01117.00
7.2.120.0050.01316.83
7.2.110.0060.00816.62
7.2.100.0050.01116.93
7.2.90.0090.00516.87
7.2.80.0020.01116.95
7.2.70.0070.00816.93
7.2.60.0070.00616.98
7.2.50.0070.00616.93
7.2.40.0060.01116.84
7.2.30.0090.00416.92
7.2.20.0050.01116.89
7.2.10.0050.01216.95
7.2.00.0050.01117.60
7.1.330.0050.00815.65
7.1.320.0030.00915.99
7.1.310.0040.00615.72
7.1.300.0030.00815.79
7.1.290.0090.00515.82
7.1.280.0050.00915.83
7.1.270.0050.00915.74
7.1.260.0090.00515.72
7.1.250.0050.00715.86
7.1.240.0070.00615.87
7.1.230.0090.00315.78
7.1.220.0030.01215.88
7.1.210.0070.00915.77
7.1.200.0020.00915.79
7.1.190.0000.01115.91
7.1.180.0030.01015.83
7.1.170.0080.00815.75
7.1.160.0060.00815.94
7.1.150.0030.01015.78
7.1.140.0050.01115.74
7.1.130.0080.00615.73
7.1.120.0080.00815.84
7.1.110.0050.00715.85
7.1.100.0040.01216.52
7.1.90.0060.00715.77
7.1.80.0030.01015.81
7.1.70.0040.00816.43
7.1.60.0070.00717.12
7.1.50.0030.01316.14
7.1.40.0020.01115.78
7.1.30.0080.00615.86
7.1.20.0070.00715.82
7.1.10.0060.00615.71
7.1.00.0010.03518.00
7.0.330.0070.01015.34
7.0.320.0050.01015.49
7.0.310.0050.01115.41
7.0.300.0100.00315.44
7.0.290.0100.00415.21
7.0.280.0020.01215.50
7.0.270.0080.00815.46
7.0.260.0020.01415.46
7.0.250.0040.01115.45
7.0.240.0080.00815.35
7.0.230.0020.00915.29
7.0.220.0060.00515.37
7.0.210.0070.00715.47
7.0.200.0080.00515.77
7.0.190.0080.00715.29
7.0.180.0070.00915.38
7.0.170.0110.00415.46
7.0.160.0080.00515.48
7.0.150.0060.00315.46
7.0.140.0060.03017.53
7.0.130.0050.00815.35
7.0.120.0080.00715.22
7.0.110.0070.00715.36
7.0.100.0080.00615.51
7.0.90.0050.01015.45
7.0.80.0090.00615.46
7.0.70.0040.01015.28
7.0.60.0130.03016.78
7.0.50.0070.03016.35
7.0.40.0080.03016.27
7.0.30.0120.02216.15
7.0.20.0120.01716.31
7.0.10.0090.01816.13
7.0.00.0040.02416.24
5.6.400.0110.00514.78
5.6.390.0060.01114.68
5.6.380.0030.01214.60
5.6.370.0050.00814.72
5.6.360.0070.01014.89
5.6.350.0040.01214.68
5.6.340.0030.01414.68
5.6.330.0040.00714.53
5.6.320.0090.00914.72
5.6.310.0040.01314.81
5.6.300.0080.00514.62
5.6.290.0030.00714.83
5.6.280.0090.02816.87
5.6.270.0090.00314.59
5.6.260.0050.00814.79
5.6.250.0040.01114.67
5.6.240.0060.00814.72
5.6.230.0060.00714.71
5.6.220.0080.00614.61
5.6.210.0060.03216.72
5.6.200.0010.02415.90
5.6.190.0090.02016.69
5.6.180.1200.01816.64
5.6.170.0120.01716.62
5.6.160.0060.02916.60
5.6.150.0040.02915.87
5.6.140.0100.02515.89
5.6.130.0080.03215.90
5.6.120.0070.01816.82
5.6.110.0070.03216.78
5.6.100.0100.02616.90
5.6.90.0080.03116.85
5.6.80.0110.02916.62
5.6.70.0110.03116.59
5.6.60.0080.00814.59
5.6.50.0050.01014.81
5.6.40.0090.00514.80
5.6.30.0070.00814.68
5.6.20.0060.00614.82
5.6.10.0040.00914.72
5.6.00.0110.00514.71
5.5.380.0070.00814.66
5.5.370.0030.01014.75
5.5.360.0070.00814.66
5.5.350.0080.03216.65
5.5.340.0060.02415.69
5.5.330.0040.03316.48
5.5.320.0160.02216.55
5.5.310.0090.01916.56
5.5.300.0030.02115.84
5.5.290.0080.03015.75
5.5.280.0030.02216.74
5.5.270.0130.02616.73
5.5.260.0120.03416.81
5.5.250.0050.03216.54
5.5.240.0070.03216.48
5.5.230.0030.00814.50
5.5.220.0050.01014.61
5.5.210.0080.00514.48
5.5.200.0030.00914.54
5.5.190.0090.00414.65
5.5.180.0040.00914.70
5.5.170.0040.01114.61
5.5.160.0050.00614.38
5.5.150.0050.00814.60
5.5.140.0060.00614.66
5.5.130.0050.01214.49
5.5.120.0080.00514.67
5.5.110.0090.00514.82
5.5.100.0130.00214.73
5.5.90.0060.00914.69
5.5.80.0050.01114.62
5.5.70.0070.00714.59
5.5.60.0080.01014.56
5.5.50.0080.00714.48
5.5.40.0030.01014.61
5.5.30.0090.00714.53
5.5.20.0100.00814.67
5.5.10.0130.00514.69
5.5.00.0080.00814.56
5.4.450.0080.02515.81
5.4.440.0200.02115.70
5.4.430.0090.02215.70
5.4.420.0050.02315.77
5.4.410.0070.02115.75
5.4.400.0320.00515.45
5.4.390.0310.00415.44
5.4.380.0110.02315.49
5.4.370.0160.02115.46
5.4.360.0200.02115.43
5.4.350.0200.01915.52
5.4.340.0160.01715.44
5.4.330.0100.00113.90
5.4.320.0070.01613.44
5.4.310.0050.01913.44
5.4.300.0050.01713.44
5.4.290.0060.02113.44
5.4.280.0060.01813.40
5.4.270.0050.01713.40
5.4.260.0060.02415.53
5.4.250.0100.02615.52
5.4.240.0130.02415.48
5.4.230.0110.02615.52
5.4.220.0130.02515.52
5.4.210.0080.02615.57
5.4.200.0100.02715.48
5.4.190.0100.02815.50
5.4.180.0110.02915.50
5.4.170.0070.02315.53
5.4.160.0090.02415.63
5.4.150.0100.02615.58
5.4.140.0040.02814.79
5.4.130.0120.02314.71
5.4.120.0090.02414.71
5.4.110.0070.03414.75
5.4.100.0080.01814.75
5.4.90.0060.02314.79
5.4.80.0140.01614.75
5.4.70.0070.02214.75
5.4.60.0040.02314.75
5.4.50.0100.02014.74
5.4.40.0080.02614.78
5.4.30.0070.02114.76
5.4.20.0090.02014.76
5.4.10.0060.02714.77
5.4.00.0090.02214.54
5.3.290.0070.01613.54
5.3.280.0070.02214.19
5.3.270.0070.02914.19
5.3.260.0060.02314.19
5.3.250.0060.02914.14
5.3.240.0050.02814.20
5.3.230.0100.02414.14
5.3.220.0070.01914.13
5.3.210.0060.02414.10
5.3.200.0070.02114.16
5.3.190.0040.02714.20
5.3.180.0070.01914.09
5.3.170.0040.02214.19
5.3.160.0060.02614.12
5.3.150.0080.02714.15
5.3.140.0090.02314.18
5.3.130.0050.02414.12
5.3.120.0040.03214.18
5.3.110.0060.03214.12
5.3.100.0020.02513.98
5.3.90.0060.02813.97
5.3.80.0060.02113.93
5.3.70.0070.02213.94
5.3.60.0030.02413.96
5.3.50.0080.02113.89
5.3.40.0050.02013.94
5.3.30.0040.02013.94
5.3.20.0070.02213.90
5.3.10.0080.01613.84
5.3.00.0020.03113.79
5.2.170.0100.04011.30
5.2.160.0130.03711.19
5.2.150.0070.04011.21
5.2.140.0070.05011.22
5.2.130.0070.04710.92
5.2.120.0100.04310.92
5.2.110.0100.03711.18
5.2.100.0100.06311.09
5.2.90.0130.05311.07
5.2.80.0030.05011.07
5.2.70.0100.04310.91
5.2.60.0130.03711.01
5.2.50.0130.05311.10
5.2.40.0170.04011.09
5.2.30.0070.04011.04
5.2.20.0070.03710.93
5.2.10.0100.04310.93
5.2.00.0130.05310.68
5.1.60.0100.03310.20
5.1.50.0100.04710.05
5.1.40.0070.0409.97
5.1.30.0070.06710.39
5.1.20.0130.05010.30
5.1.10.0130.04010.18
5.1.00.0030.04010.06
5.0.50.0070.0308.63
5.0.40.0070.0378.38
5.0.30.0070.0608.22
5.0.20.0030.0308.28
5.0.10.0130.0338.15
5.0.00.0030.0408.32
4.4.90.0130.0207.54
4.4.80.0030.0307.54
4.4.70.0030.0237.54
4.4.60.0130.0237.54
4.4.50.0070.0237.54
4.4.40.0070.0477.54
4.4.30.0100.0277.54
4.4.20.0070.0307.54
4.4.10.0030.0277.54
4.4.00.0070.0407.54
4.3.110.0000.0307.54
4.3.100.0130.0177.54
4.3.90.0000.0337.54
4.3.80.0070.0437.54
4.3.70.0100.0237.54
4.3.60.0100.0277.54
4.3.50.0070.0207.54
4.3.40.0030.0377.54
4.3.30.0000.0307.54
4.3.20.0070.0277.54
4.3.10.0030.0277.54
4.3.00.0100.0178.20

preferences:
39.27 ms | 400 KiB | 5 Q