3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', ]; function multisort($array) { array_multisort(array_map('strlen', $array), SORT_DESC, $array); printf( "Total strlen() calls: %d\n%s\n---\n", count($array), var_export($array, true) ); } function usersort($array) { usort( $array, function($a, $b) { echo "strlen() called twice\n"; return strlen($b) <=> strlen($a); } ); var_export($array); echo "\n---\n"; } multisort($array); usersort($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.4.140.0120.01117.65
8.4.130.0100.01117.86
8.4.120.0080.01020.73
8.4.110.0090.01318.78
8.4.100.0070.00218.85
8.4.90.0090.00820.61
8.4.80.0030.00618.93
8.4.70.0110.00919.49
8.4.60.0110.00918.79
8.4.50.0100.01118.72
8.4.40.0130.00719.27
8.4.30.0070.01020.49
8.4.20.0100.01020.54
8.4.10.0060.00324.00
8.3.270.0110.00916.83
8.3.260.0130.00616.73
8.3.250.0130.00718.65
8.3.240.0110.00816.57
8.3.230.0140.00516.74
8.3.220.0060.00119.16
8.3.210.0090.01016.60
8.3.200.0040.00516.85
8.3.190.0080.00817.12
8.3.180.0090.00916.57
8.3.170.0000.00818.83
8.3.160.0060.00320.14
8.3.150.0110.00716.54
8.3.140.0050.00318.96
8.3.130.0060.00316.48
8.3.120.0080.00418.86
8.3.110.0000.00920.94
8.3.100.0100.00024.06
8.3.90.0100.00726.77
8.3.80.0090.00016.75
8.3.70.0060.01516.63
8.3.60.0060.01518.53
8.3.50.0060.00920.06
8.3.40.0150.00018.41
8.3.30.0090.00518.90
8.3.20.0070.00024.18
8.3.10.0080.00024.66
8.3.00.0040.00426.16
8.2.290.0080.00820.38
8.2.280.0070.00718.42
8.2.270.0050.00318.78
8.2.260.0090.00916.45
8.2.250.0060.00316.67
8.2.240.0070.00317.36
8.2.230.0040.00422.58
8.2.220.0050.00337.54
8.2.210.0140.00026.77
8.2.200.0070.00716.88
8.2.190.0110.01416.58
8.2.180.0120.00425.92
8.2.170.0110.00418.84
8.2.160.0130.00722.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0030.00621.18
8.2.110.0030.00620.64
8.2.100.0120.00317.78
8.2.90.0030.00619.43
8.2.80.0100.00018.66
8.2.70.0060.00317.63
8.2.60.0110.00017.90
8.2.50.0000.00818.07
8.2.40.0030.00518.09
8.2.30.0000.00718.12
8.2.20.0040.00420.50
8.2.10.0070.00018.04
8.2.00.0070.00019.32
8.1.330.0120.00616.16
8.1.320.0110.00916.00
8.1.310.0070.01018.15
8.1.300.0030.00618.36
8.1.290.0050.00530.84
8.1.280.0040.01125.92
8.1.270.0090.00023.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0070.00422.18
8.1.230.0040.00820.90
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0030.00617.36
8.1.190.0000.00817.35
8.1.180.0030.00518.10
8.1.170.0030.00918.42
8.1.160.0060.00318.96
8.1.150.0070.00018.69
8.1.140.0080.00017.48
8.1.130.0000.00718.93
8.1.120.0000.00717.53
8.1.110.0030.00517.47
8.1.100.0040.00417.33
8.1.90.0000.00817.46
8.1.80.0040.00717.37
8.1.70.0000.00717.55
8.1.60.0040.00417.66
8.1.50.0190.00617.48
8.1.40.0220.00717.59
8.1.30.0190.00917.58
8.1.20.0270.00017.68
8.1.10.0220.00617.56
8.1.00.0190.00317.38
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0000.00718.49
8.0.270.0000.00818.04
8.0.260.0030.00318.46
8.0.250.0030.00316.89
8.0.240.0000.00817.07
8.0.230.0030.00316.96
8.0.220.0030.00316.97
8.0.210.0000.01016.95
8.0.200.0040.00417.00
8.0.190.0000.00816.86
8.0.180.0030.00616.96
8.0.170.0180.00016.95
8.0.160.0170.00416.77
8.0.150.0200.00416.79
8.0.140.0170.00716.83
8.0.130.0140.00916.96
8.0.120.0150.00616.86
8.0.110.0150.00616.89
8.0.100.0100.00916.73
8.0.90.0150.00816.80
8.0.80.0150.00616.90
8.0.70.0130.00716.65
8.0.60.0150.00016.79
8.0.50.0040.00716.86
8.0.30.0070.00716.84
8.0.20.0140.00416.86
8.0.10.0100.01017.07
7.4.330.0020.00215.55
7.4.320.0030.00316.61
7.4.300.0040.00416.52
7.4.290.0130.00016.48
7.4.280.0070.00416.51
7.4.270.0100.00316.36
7.4.260.0170.00616.54
7.4.250.0110.00816.52
7.4.240.0080.00816.40
7.4.230.0000.01116.60
7.4.220.0040.00816.59
7.4.210.0090.00716.61
7.4.200.0170.00416.62
7.4.190.0190.00416.67
7.4.180.0160.00316.65
7.4.160.0100.00516.61
7.4.150.0160.00016.46
7.4.140.0070.01316.36
7.4.130.0120.01016.42
7.4.120.0190.00316.44
7.4.110.0180.00316.36
7.4.100.0160.00316.48
7.4.90.0200.00316.46
7.4.80.0220.00016.41
7.4.70.0190.00416.48
7.4.60.0170.00416.45
7.4.50.0150.00416.41
7.4.40.0180.00316.28
7.4.30.0160.00016.45
7.4.20.0180.00316.37
7.4.10.0110.00816.36
7.4.00.0060.00916.54

preferences:
29.82 ms | 403 KiB | 5 Q