3v4l.org

run code in 300+ PHP versions simultaneously
<?php function make_ascii($str) { //return $str; $special = array('ľ','š','č','ť','ž','ý','á','í','é','ú','ä','ô','ň','ě'); $ascii = array('l','s','c','t','z','y','a','i','e','u','a','o','n','e'); $str = array_map(function ($i) use ($str) { return mb_substr($str, $i, 1); }, range(0, mb_strlen($str) -1)); //$str = preg_split("//u",$str); foreach ($str as $k => $c) { if( mb_strtoupper($c, "UTF-8") == $c) { $u = true; $c = mb_strtolower($c); } else { $u = false; } // print_r($c); if(in_array($c, $special)) { $c = $ascii[array_search($c, $special)]; } if($u) { $c = mb_strtoupper($c); } $str[$k] = $c; } return join($str); } $str = "ľÁľa ýellow"; var_dump(make_ascii($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.4.140.0100.01117.77
8.4.130.0090.00918.54
8.4.120.0080.00624.43
8.4.110.0060.00318.67
8.4.100.0060.00418.54
8.4.90.0050.00420.90
8.4.80.0060.01417.84
8.4.70.0040.00417.80
8.4.60.0100.01018.55
8.4.50.0050.00418.93
8.4.40.0130.00318.96
8.4.30.0130.00717.54
8.4.20.0130.00717.56
8.4.10.0100.00719.65
8.3.270.0130.00716.49
8.3.260.0090.01116.32
8.3.250.0110.00718.81
8.3.240.0090.01017.30
8.3.230.0100.00716.51
8.3.220.0050.00318.83
8.3.210.0080.01016.64
8.3.200.0050.00416.71
8.3.190.0130.00517.22
8.3.180.0090.00916.57
8.3.170.0090.00918.95
8.3.160.0030.00618.52
8.3.150.0090.00916.64
8.3.140.0080.00016.60
8.3.130.0040.00418.48
8.3.120.0040.00418.95
8.3.110.0080.00020.94
8.3.100.0080.00016.50
8.3.90.0080.00018.36
8.3.80.0090.00018.43
8.3.70.0100.01016.63
8.3.60.0150.00616.75
8.3.50.0110.00618.34
8.3.40.0110.00418.81
8.3.30.0090.00618.66
8.3.20.0040.00420.39
8.3.10.0080.00021.91
8.3.00.0040.00423.66
8.2.290.0130.00520.88
8.2.280.0040.00420.30
8.2.270.0090.00018.96
8.2.260.0130.00616.69
8.2.250.0050.00518.54
8.2.240.0030.00617.48
8.2.230.0070.01022.58
8.2.220.0040.00424.06
8.2.210.0110.00426.77
8.2.200.0040.00416.63
8.2.190.0040.01116.63
8.2.180.0060.01018.41
8.2.170.0040.01122.96
8.2.160.0100.00720.35
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0000.00826.16
8.2.120.0070.00317.75
8.2.110.0040.00719.39
8.2.100.0110.00017.72
8.2.90.0040.00417.84
8.2.80.0080.00419.22
8.2.70.0030.00618.05
8.2.60.0040.00418.28
8.2.50.0050.00318.10
8.2.40.0000.00720.65
8.2.30.0080.00021.09
8.2.20.0040.00418.24
8.2.10.0040.00418.05
8.2.00.0000.00818.18
8.1.330.0120.00721.98
8.1.320.0100.01116.22
8.1.310.0120.00318.31
8.1.300.0060.00317.80
8.1.290.0080.00018.88
8.1.280.0070.00725.92
8.1.270.0080.00022.18
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00022.19
8.1.230.0070.00421.04
8.1.220.0030.00517.74
8.1.210.0030.00519.02
8.1.200.0030.00617.38
8.1.190.0040.00417.35
8.1.180.0080.00018.10
8.1.170.0080.00018.94
8.1.160.0000.00718.96
8.1.150.0000.00720.15
8.1.140.0020.00519.70
8.1.130.0070.00020.86
8.1.120.0000.00717.44
8.1.110.0030.00617.53
8.1.100.0000.00717.47
8.1.90.0040.00417.45
8.1.80.0000.00717.59
8.1.70.0040.00417.57
8.1.60.0040.00417.55
8.1.50.0000.00817.60
8.1.40.0030.00617.61
8.1.30.0080.00317.76
8.1.20.0050.00317.63
8.1.10.0040.00417.64
8.1.00.0050.00517.51
8.0.300.0050.00220.10
8.0.290.0040.00416.88
8.0.280.0040.00418.39
8.0.270.0040.00417.33
8.0.260.0040.00420.32
8.0.250.0000.00717.02
8.0.240.0070.00016.99
8.0.230.0070.00016.94
8.0.220.0000.00716.92
8.0.210.0050.00216.93
8.0.200.0030.00316.97
8.0.190.0040.00716.95
8.0.180.0070.00017.00
8.0.170.0080.00016.93
8.0.160.0040.00416.87
8.0.150.0000.00716.85
8.0.140.0030.00516.99
8.0.130.0000.00513.43
8.0.120.0040.00417.04
8.0.110.0000.00716.89
8.0.100.0040.00416.92
8.0.90.0000.00817.01
8.0.80.0090.00616.96
8.0.70.0080.00016.89
8.0.60.0030.00516.91
8.0.50.0070.00016.95
8.0.30.0070.01217.13
8.0.20.0110.01017.40
8.0.10.0040.00417.06
8.0.00.0040.01416.90
7.4.330.0000.00515.55
7.4.320.0030.00316.48
7.4.300.0030.00316.52
7.4.290.0020.00516.67
7.4.280.0050.00216.52
7.4.270.0000.00716.57
7.4.260.0000.00716.71
7.4.250.0040.00416.51
7.4.240.0030.00316.69
7.4.230.0000.00716.50
7.4.220.0060.01616.58
7.4.210.0150.00616.63
7.4.200.0000.00716.51
7.4.160.0100.00616.52
7.4.150.0140.00417.40
7.4.140.0080.01017.86
7.4.130.0090.00916.32
7.4.120.0130.00616.63
7.4.110.0140.00416.55
7.4.100.0070.01416.44
7.4.90.0070.01316.48
7.4.80.0120.01219.39
7.4.70.0090.01316.61
7.4.60.0130.00316.69
7.4.50.0080.00516.40
7.4.40.0060.00916.53
7.4.30.0130.00316.54
7.4.00.0070.00714.88
7.3.330.0050.00013.46
7.3.320.0030.00313.32
7.3.310.0060.00016.53
7.3.300.0000.00716.50
7.3.290.0090.00916.46
7.3.280.0100.00716.47
7.3.270.0120.00917.40
7.3.260.0110.00716.52
7.3.250.0120.01216.51
7.3.240.0130.00816.46
7.3.230.0120.00616.48
7.3.210.0120.00616.50
7.3.200.0130.00716.37
7.3.190.0090.00616.43
7.3.180.0110.00716.68
7.3.170.0150.00316.48
7.3.160.0060.00916.41
7.3.10.0200.00016.16
7.3.00.0070.01016.44
7.2.330.0150.00316.50
7.2.320.0090.01216.58
7.2.310.0100.01316.80
7.2.300.0030.01316.77
7.2.290.0120.01216.85
7.2.130.0090.00616.91
7.2.120.0030.01316.54
7.2.110.0080.01216.42
7.2.100.0140.01016.86
7.2.90.0080.00816.59
7.2.80.0000.01216.77
7.2.70.0000.01116.85
7.2.60.0090.00517.05
7.2.50.0120.00616.83
7.2.40.0060.01016.55
7.2.30.0110.01417.07
7.2.20.0070.00717.16
7.2.10.0110.00616.88
7.2.00.0130.00017.13
7.1.250.0150.00315.39
7.1.200.0070.00715.82
7.1.100.0040.01118.20
7.1.90.0050.00918.09
7.1.80.0080.00818.19
7.1.70.0030.00917.40
7.1.60.0160.00935.32
7.1.50.0160.01034.89
7.1.40.0130.01334.72
7.1.30.0150.01134.62
7.1.20.0200.00734.59
7.1.10.0070.00716.57
7.1.00.0060.01316.71
7.0.240.0040.01418.00
7.0.230.0120.00318.05
7.0.220.0030.01517.79
7.0.210.0060.00616.78
7.0.200.0090.00316.76
7.0.190.0030.00916.93
7.0.180.0030.00916.20
7.0.170.0030.01216.33
7.0.160.0070.00716.04
7.0.150.0030.01316.43
7.0.140.0040.01416.56
7.0.130.0030.01016.73
7.0.120.0060.00716.49
7.0.110.0000.01316.45
7.0.100.0060.00616.58
7.0.90.0040.00916.28
7.0.80.0000.01416.37
7.0.70.0040.01516.46
7.0.60.0000.01316.14
7.0.50.0000.01416.39
7.0.40.0040.01116.52
7.0.30.0000.01216.30
7.0.20.0030.01016.35
7.0.10.0050.01116.50
7.0.00.0050.01316.50

preferences:
30.99 ms | 403 KiB | 5 Q