3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strs = [ 'Ostroměr', 'Šventaragis', 'Świętopełk', 'Dušan', 'Živko', ]; /** * Decodes a url-encoded path segment. */ function decodePathSegment(string $path): string { $path = rawurldecode($path); $encoding = mb_detect_encoding($path, ['UTF-8', 'ISO-8859-1']); switch ($encoding) { case 'ISO-8859-1': $path = utf8_encode($path); } return $path; } foreach($strs as $str) { var_dump(decodePathSegment($str)); }

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.10.0090.00918.39
8.5.00.0130.00820.11
8.4.150.0020.00014.05
8.4.140.0160.00517.60
8.4.130.0110.00417.93
8.4.120.0110.00820.77
8.4.110.0140.00618.83
8.4.100.0050.00518.49
8.4.90.0120.00820.61
8.4.80.0040.00618.83
8.4.70.0060.00319.03
8.4.60.0080.00518.39
8.4.50.0190.00917.85
8.4.40.0080.00319.51
8.4.30.0080.00820.29
8.4.20.0120.00917.66
8.4.10.0030.00521.99
8.3.280.0130.00818.40
8.3.270.0080.01116.29
8.3.260.0130.00716.36
8.3.250.0120.00717.12
8.3.240.0130.00616.55
8.3.230.0110.00816.41
8.3.220.0060.00219.11
8.3.210.0090.01016.61
8.3.200.0050.00416.57
8.3.190.0090.00616.98
8.3.180.0110.00918.57
8.3.170.0050.00316.56
8.3.160.0140.00317.19
8.3.150.0100.01017.00
8.3.140.0080.00020.84
8.3.130.0120.00318.35
8.3.120.0060.00320.78
8.3.110.0040.00420.94
8.3.100.0050.00516.65
8.3.90.0130.00626.77
8.3.80.0030.00616.38
8.3.70.0060.01216.58
8.3.60.0090.00616.75
8.3.50.0070.01020.10
8.3.40.0070.00718.54
8.3.30.0150.00019.04
8.3.20.0040.00424.18
8.3.10.0070.00024.66
8.3.00.0080.00026.16
8.2.290.0100.01020.66
8.2.280.0130.00618.75
8.2.270.0110.00716.79
8.2.260.0160.00316.87
8.2.250.0080.00018.91
8.2.240.0060.00317.72
8.2.230.0070.00022.58
8.2.220.0000.00724.06
8.2.210.0000.00726.77
8.2.200.0040.00416.63
8.2.190.0170.00316.75
8.2.180.0100.00725.92
8.2.170.0160.00319.16
8.2.160.0070.00722.96
8.2.150.0030.00625.66
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0070.00021.18
8.2.110.0060.00320.71
8.2.100.0030.01020.40
8.2.90.0040.00418.00
8.2.80.0060.00318.89
8.2.70.0000.00817.59
8.2.60.0090.00017.75
8.2.50.0030.00517.98
8.2.40.0040.00418.41
8.2.30.0000.00718.16
8.2.20.0080.00020.58
8.2.10.0000.00718.22
8.2.00.0040.00419.41
8.1.330.0100.00922.04
8.1.320.0090.01016.44
8.1.310.0040.00416.26
8.1.300.0100.01018.36
8.1.290.0070.00330.84
8.1.280.0090.01225.92
8.1.270.0030.00523.99
8.1.260.0090.00326.35
8.1.250.0040.00428.09
8.1.240.0100.00022.10
8.1.230.0090.00321.09
8.1.220.0040.00418.01
8.1.210.0050.00318.77
8.1.200.0040.00417.60
8.1.190.0080.00017.48
8.1.180.0000.00818.10
8.1.170.0040.00417.62
8.1.160.0040.00420.73
8.1.150.0000.00718.70
8.1.140.0040.00417.51
8.1.130.0000.00719.08
8.1.120.0050.00317.65
8.1.110.0000.00717.55
8.1.100.0050.00217.67
8.1.90.0000.00717.70
8.1.80.0000.00917.68
8.1.70.0030.00517.60
8.1.60.0090.00017.73
8.1.50.0080.00017.64
8.1.40.0040.00817.65
8.1.30.0060.00817.68
8.1.20.0120.00917.70
8.1.10.0220.00017.66
8.1.00.0230.00017.70
8.0.300.0030.00618.77
8.0.290.0050.00216.88
8.0.280.0040.00418.54
8.0.270.0030.00316.87
8.0.260.0030.00318.50
8.0.250.0000.00717.07
8.0.240.0040.00417.07
8.0.230.0030.00316.95
8.0.220.0040.00416.99
8.0.210.0000.00717.02
8.0.200.0030.00317.07
8.0.190.0040.00417.02
8.0.180.0070.00716.93
8.0.170.0120.00316.88
8.0.160.0090.00517.00
8.0.150.0110.00416.98
8.0.140.0090.00616.97
8.0.130.0170.00016.94
8.0.120.0100.00317.04
8.0.110.0130.00216.93
8.0.100.0160.00316.90
8.0.90.0100.00317.02
8.0.80.0160.00016.95
8.0.70.0140.00517.07
8.0.60.0150.00417.01
8.0.50.0140.00516.98
8.0.30.0160.00317.00
8.0.20.0120.00616.92
8.0.10.0120.00616.98
7.4.330.0000.00515.55
7.4.320.0040.00416.66
7.4.300.0000.00616.72
7.4.290.0130.00916.63
7.4.280.0090.01316.71
7.4.270.0190.00416.61
7.4.260.0220.00016.59
7.4.250.0070.01416.70
7.4.240.0190.00316.74
7.4.230.0200.00316.71
7.4.220.0140.00816.79
7.4.210.0170.00316.73
7.4.200.0060.01316.70
7.4.190.0200.00016.70
7.4.180.0100.01016.66
7.4.160.0120.00716.67
7.4.150.0060.00916.53
7.4.140.0110.00416.61
7.4.130.0080.00416.56
7.4.120.0150.00016.45
7.4.110.0100.01016.55
7.4.100.0160.00316.63
7.4.90.0190.00016.62
7.4.80.0180.00316.48
7.4.70.0170.00316.54
7.4.60.0160.00416.50
7.4.50.0140.00316.47
7.4.40.0060.00616.53
7.4.30.0030.00616.67
7.4.20.0050.00516.73
7.4.10.0060.00616.70
7.4.00.0110.00316.65

preferences:
32.56 ms | 403 KiB | 5 Q