3v4l.org

run code in 300+ PHP versions simultaneously
<?php // const FILE_FORBIDDEN_CHRARS = ['¥', '\\', '/', ':', '*', '?', '"', '<', '>', '|', ' ', ' ']; // $filename = 'あ い:う<えおE_ALBUM_撮影📷'; // $result = str_replace(FILE_FORBIDDEN_CHRARS, '', $filename); // echo $result; function removeNonBasicMultilingualPlaneChars($p_text) { $mb_encode = mb_detect_encoding($p_text); if ($mb_encode == "UTF-8") { $converted = mb_convert_encoding(mb_convert_encoding($p_text, 'sjis', 'UTF-8'), 'UTF-8', 'sjis'); } else { $converted = mb_convert_encoding(mb_convert_encoding($p_text, 'sjis-win', 'UTF-8'), 'UTF-8', 'sjis-win'); } return $converted; } $input = "あ い:う<えおE_ALBUM_撮影📷あいう🐱えお"; // 例として日本語と絵文字を含む文字列を使用 $output = removeNonBasicMultilingualPlaneChars($input); echo $output; // 出力: あいうえお

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.3.70.0150.00016.75
8.3.60.0470.00725.92
8.3.50.0250.01125.92
8.3.40.0220.01425.92
8.3.30.0240.01425.92
8.3.20.0320.00925.92
8.3.10.0330.00725.92
8.3.00.0280.01525.92
8.2.190.0100.00616.63
8.2.180.0410.00425.92
8.2.170.0470.00325.92
8.2.160.0380.01325.92
8.2.150.0250.01825.92
8.2.140.0400.00625.92
8.2.130.0300.01925.92
8.2.120.0490.00725.92
8.2.110.0450.00325.92
8.2.100.0380.01025.92
8.2.90.0370.01025.92
8.2.80.0360.01225.92
8.2.70.0430.00425.92
8.2.60.0460.00425.92
8.2.50.0450.00325.92
8.2.40.0300.01325.92
8.2.30.0320.01225.92
8.2.20.0510.00725.92
8.2.10.0400.00425.92
8.2.00.0380.00625.92
8.1.280.0390.01025.92
8.1.270.0320.01825.92
8.1.260.0360.00425.92
8.1.250.0360.00325.92
8.1.240.0320.00625.92
8.1.230.0280.00725.92
8.1.220.0340.00925.92
8.1.210.0400.00325.92
8.1.200.0350.00725.92
8.1.190.0260.00425.92
8.1.180.0230.00825.92
8.1.170.0280.00425.92
8.1.160.0260.00925.92
8.1.150.0260.01325.92
8.1.140.0280.00825.92
8.1.130.0300.01125.92
8.1.120.0340.00725.92
8.1.110.0280.01125.92
8.1.100.0260.01025.92
8.1.90.0320.00425.92
8.1.80.0310.00025.92
8.1.70.0190.01125.92
8.1.60.0230.01225.92
8.1.50.0300.01525.92
8.1.40.0480.00025.92
8.1.30.0470.01625.92
8.1.20.0430.00625.92
8.1.10.0310.01525.92
8.1.00.0270.01725.92

preferences:
22.52 ms | 401 KiB | 5 Q