3v4l.org

run code in 300+ PHP versions simultaneously
<?php $file = 'ыыыыыыыы'; if (function_exists('transliterator_transliterate') && function_exists('iconv')) { echo 'ICONV Available' .PHP_EOL; } // Remove any trailing dots, as those aren't ever valid file names. $file = rtrim($file, '.'); // Try transliterating the file name using the native php function if (function_exists('transliterator_transliterate') && function_exists('iconv')) { echo 'transliterating YES' .PHP_EOL; // Using iconv to ignore characters that can't be transliterated $file = iconv("UTF-8", "ASCII//TRANSLIT//IGNORE", transliterator_transliterate('Any-Latin; Latin-ASCII; Lower()', $file)); } $regex = array('#(\.){2,}#', '#[^A-Za-z0-9\.\_\- ]#', '#^\.#'); $name = trim(preg_replace($regex, '', $file)); var_dump($name);

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.0170.05321.30
8.4.130.0110.01721.74
8.4.120.0060.02023.99
8.4.110.0100.02324.16
8.4.100.0070.01821.35
8.4.90.0110.04324.11
8.4.80.0110.02024.12
8.4.70.0150.04322.49
8.4.60.0150.04225.90
8.4.50.0150.03222.30
8.4.40.0030.03123.14
8.4.30.0030.04723.82
8.4.20.0070.02322.18
8.4.10.0070.04321.50
8.3.270.0150.05320.25
8.3.260.0100.03620.50
8.3.250.0060.01920.39
8.3.240.0050.02020.25
8.3.230.0110.04320.23
8.3.220.0120.03522.37
8.3.210.0090.02520.30
8.3.200.0070.02220.32
8.3.190.0130.04720.73
8.3.180.0110.03122.56
8.3.170.0100.03720.55
8.3.160.0150.04622.41
8.3.150.0100.04020.29
8.3.140.0130.04020.37
8.3.130.0040.02520.46
8.3.120.0070.04724.38
8.3.110.0140.03120.02
8.3.100.0230.04320.26
8.3.90.0070.03326.77
8.3.80.0130.02022.06
8.3.70.0130.04020.11
8.3.60.0140.03820.26
8.3.50.0200.04921.62
8.3.40.0070.02522.50
8.3.30.0120.01922.44
8.3.20.0000.01625.58
8.3.10.0100.00725.48
8.3.00.0000.01626.16
8.2.290.0150.03520.68
8.2.280.0100.03321.98
8.2.270.0230.03320.18
8.2.260.0170.04420.83
8.2.250.0070.02122.40
8.2.240.0100.02020.26
8.2.230.0030.02620.94
8.2.220.0100.02024.06
8.2.210.0070.03326.77
8.2.200.0100.02320.31
8.2.190.0130.05920.15
8.2.180.0030.04825.92
8.2.170.0200.02022.76
8.2.160.0160.01623.98
8.2.150.0070.01125.66
8.2.140.0070.01124.66
8.2.130.0000.01726.16
8.2.120.0000.01826.35
8.2.110.0030.01625.61
8.2.100.0130.01321.66
8.2.90.0070.01321.63
8.2.80.0000.02122.41
8.2.70.0030.01721.68
8.2.60.0140.01121.78
8.2.50.0080.01921.63
8.2.40.0030.01724.65
8.2.30.0060.01522.73
8.2.20.0000.02021.93
8.2.10.0030.01723.04
8.2.00.0000.02122.93
8.1.330.0110.04619.98
8.1.320.0330.07119.85
8.1.310.0310.02420.30
8.1.300.0070.02421.79
8.1.290.0030.02930.84
8.1.280.0130.03725.92
8.1.270.0030.01325.64
8.1.260.0100.00728.09
8.1.250.0030.01328.09
8.1.240.0040.01525.53
8.1.230.0000.02521.70
8.1.220.0030.01721.66
8.1.210.0000.02221.23
8.1.200.0000.02421.13
8.1.190.0090.01221.13
8.1.180.0040.01821.40
8.1.170.0100.01022.63
8.1.160.0100.01022.54
8.1.150.0000.02222.55
8.1.140.0070.01322.52
8.1.130.0030.01623.68
8.1.120.0030.01921.60
8.1.110.0000.02021.55
8.1.100.0000.02021.45
8.1.90.0070.01321.48
8.1.80.0100.01021.36
8.1.70.0030.01621.48
8.1.60.0070.01321.56
8.1.50.0030.01821.43
8.1.40.0060.01521.53
8.1.30.0110.01121.80
8.1.20.0030.01921.64
8.1.10.0030.01721.54
8.1.00.0030.01621.53
8.0.300.0030.01621.89
8.0.290.0060.01520.75
8.0.280.0060.01321.98
8.0.270.0000.02020.69
8.0.260.0030.01621.97
8.0.250.0030.01720.92
8.0.240.0030.01620.78
8.0.230.0040.01520.87
8.0.220.0070.01420.84
8.0.210.0040.01620.74
8.0.200.0030.01720.73
8.0.190.0030.01720.87
8.0.180.0070.01320.95
8.0.170.0030.02220.68
8.0.160.0030.01620.78
8.0.150.0130.00720.75
8.0.140.0070.01720.88
8.0.130.0030.00313.45
8.0.120.0070.01720.98
8.0.110.0070.01621.00
8.0.100.0000.02120.98
8.0.90.0040.01820.99
8.0.80.0100.03821.03
8.0.70.0070.01421.03
8.0.60.0060.01521.16
8.0.50.0060.01521.13
8.0.30.0190.03421.02
8.0.20.0160.03321.16
8.0.10.0280.02521.24
8.0.00.0250.02921.07
7.4.330.0070.00015.55
7.4.320.0030.01520.62
7.4.300.0060.01220.54
7.4.290.0030.01620.46
7.4.280.0060.02520.64
7.4.270.0040.01520.66
7.4.260.0000.00613.50
7.4.250.0070.01420.72
7.4.240.0030.01920.68
7.4.230.0070.01420.84
7.4.220.0040.01720.71
7.4.210.0170.03220.70
7.4.200.0030.01720.82
7.4.160.0180.03320.66
7.4.150.0260.02920.73
7.4.140.0210.03720.66
7.4.130.0120.03020.57
7.4.120.0090.03320.58
7.4.110.0130.04420.73
7.4.100.0030.03720.71
7.4.90.0090.03620.57
7.4.80.0090.04920.64
7.4.70.0030.03720.53
7.4.60.0160.02620.58
7.4.50.0080.03320.64
7.4.40.0080.03120.65
7.4.30.0120.03120.80
7.4.20.0000.04020.48
7.4.10.0150.03120.64
7.4.00.0120.02920.61
7.3.330.0030.01620.24
7.3.320.0090.00012.98
7.3.310.0000.02020.41
7.3.300.0030.01720.39
7.3.290.0090.03820.36
7.3.280.0100.02820.40
7.3.270.0150.04120.30
7.3.260.0270.02720.44
7.3.250.0190.02520.37
7.3.240.0260.03220.37
7.3.230.0030.03620.28
7.3.220.0180.03920.24
7.3.210.0100.02920.24
7.3.200.0130.04520.26
7.3.190.0210.03920.28
7.3.180.0140.02620.24
7.3.170.0090.03020.23
7.3.160.0140.02820.32
7.3.150.0090.03120.33
7.3.140.0100.03420.29
7.3.130.0070.03920.22
7.3.120.0100.03020.14
7.3.110.0070.03520.20
7.3.100.0080.03320.07
7.3.90.0100.03020.51
7.3.80.0030.03820.25
7.3.70.0130.03220.42
7.3.60.0150.02620.51
7.3.50.0120.03020.49
7.3.40.0180.02520.46
7.3.30.0160.02920.46
7.3.20.0200.02120.51
7.3.10.0210.02120.29
7.3.00.0160.02720.32

preferences:
36.03 ms | 403 KiB | 5 Q