3v4l.org

run code in 300+ 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.4.10.0110.00819.54
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.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.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:
35.16 ms | 403 KiB | 5 Q