3v4l.org

run code in 500+ PHP versions simultaneously
<?php // Yes we can use special chars in identifiers! class ñßü {} $chars = ['aa', 'az', 'b', 'c', 'x', 'za', 'ä', 'ü', 'ß', 'ñ']; // Put the lowercase chars twice to identify if they have equal weight. $chars = [...$chars, ...array_map(ucfirst(...), $chars), ...$chars]; foreach ([ 'usort + strcmp' => fn (&$arr) => usort($arr, strcmp(...)), 'usort + strcasecmp' => fn (&$arr) => usort($arr, strcasecmp(...)), 'sort' => sort(...), ] as $name => $sortfunction) { $chars_sorted = $chars; $sortfunction($chars_sorted); print implode(', ', $chars_sorted) . " # $name\n"; }

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.5.80.0090.00916.89
8.5.70.0090.00816.70
8.5.60.0090.01016.77
8.5.50.0040.00416.73
8.5.30.0100.00819.61
8.5.20.0110.00720.08
8.5.10.0110.00819.77
8.5.00.0110.01120.19
8.4.230.0130.01019.43
8.4.220.0110.01019.73
8.4.210.0050.00521.27
8.4.180.0130.01019.73
8.4.170.0130.00923.50
8.4.160.0100.01122.18
8.4.150.0060.00616.83
8.4.140.0160.00617.72
8.4.130.0110.01017.82
8.4.120.0090.01222.55
8.4.110.0140.00822.72
8.4.100.0110.01018.01
8.4.90.0100.01019.04
8.4.80.0110.00917.89
8.4.70.0070.01217.80
8.4.60.0120.00919.10
8.4.50.0130.00719.69
8.4.40.0000.00818.03
8.4.30.0030.01324.03
8.4.20.0160.00019.71
8.4.10.0110.00819.54
8.3.320.0100.00918.63
8.3.310.0150.00418.71
8.3.300.0120.00820.91
8.3.290.0090.01020.72
8.3.280.0120.00818.44
8.3.270.0120.00816.59
8.3.260.0110.00516.53
8.3.250.0110.00719.10
8.3.240.0130.00616.49
8.3.230.0080.01116.81
8.3.220.0040.00417.37
8.3.210.0040.00616.69
8.3.200.0030.00616.58
8.3.190.0110.00716.80
8.3.180.0080.00316.78
8.3.170.0130.00617.21
8.3.160.0040.00416.66
8.3.150.0090.00917.19
8.3.140.0120.00318.71
8.3.130.0040.00416.64
8.3.120.0280.01416.59
8.3.110.0160.01416.43
8.3.100.0160.00616.63
8.3.90.0200.00216.62
8.3.80.0230.01016.32
8.3.70.0140.00916.62
8.3.60.0270.00916.33
8.3.50.0250.00816.37
8.3.40.0270.00717.36
8.3.30.0290.00717.16
8.3.20.0260.01617.28
8.3.10.0340.00317.51
8.3.00.0170.01019.17
8.2.320.0100.01018.04
8.2.310.0130.00718.14
8.2.300.0130.00820.50
8.2.290.0130.00620.20
8.2.280.0080.00916.96
8.2.270.0120.00618.60
8.2.260.0060.01217.30
8.2.250.0110.00416.70
8.2.240.0430.00416.57
8.2.230.0350.00616.61
8.2.220.0320.00816.57
8.2.210.0370.00316.30
8.2.200.0310.00916.62
8.2.190.0340.00616.78
8.2.180.0290.00816.71
8.2.170.0310.00917.34
8.2.160.0350.00617.66
8.2.150.0340.00917.17
8.2.140.0310.01417.27
8.2.130.0210.01317.27
8.2.120.0210.00617.32
8.2.110.0260.00617.57
8.2.100.0200.00017.54
8.2.90.0100.01017.59
8.2.80.0270.00717.61
8.2.70.0200.00317.49
8.2.60.0130.00617.53
8.2.50.0270.01217.37
8.2.40.0360.00317.48
8.2.30.0310.00617.40
8.2.20.0320.00717.33
8.2.10.0290.01017.40
8.2.00.0320.00617.44
8.1.340.0110.01020.15
8.1.330.0070.00721.79
8.1.320.0100.01016.20
8.1.310.0070.00718.57
8.1.300.0340.00716.09
8.1.290.0430.00016.16
8.1.280.0280.00816.21
8.1.270.0180.01117.41
8.1.260.0230.00816.84
8.1.250.0130.00917.23
8.1.240.0150.00317.26
8.1.230.0300.00717.30
8.1.220.0300.00717.43
8.1.210.0290.00817.08
8.1.200.0210.01516.98
8.1.190.0260.00717.22
8.1.180.0250.00616.91
8.1.170.0200.01017.18
8.1.160.0280.00317.47
8.1.150.0280.00917.06
8.1.140.0300.01616.87
8.1.130.0320.01017.09
8.1.120.0280.00717.29
8.1.110.0160.01917.01
8.1.100.0270.01017.26
8.1.90.0290.00817.37
8.1.80.0170.00917.35
8.1.70.0310.00617.27
8.1.60.0340.00617.55
8.1.50.0290.01117.14
8.1.40.0330.00717.37
8.1.30.0250.01117.56
8.1.20.0330.00017.51
8.1.10.0260.00817.21
8.1.00.0250.00917.42

preferences:
73.45 ms | 1075 KiB | 5 Q