3v4l.org

run code in 300+ PHP versions simultaneously
<?php function removeEmoji($text) { $clean_text = ""; // Match Emoticons $regexEmoticons = '/[\x{1F600}-\x{1F64F}]/u'; $clean_text = preg_replace($regexEmoticons, '', $text); // Match Miscellaneous Symbols and Pictographs $regexSymbols = '/[\x{1F300}-\x{1F5FF}]/u'; $clean_text = preg_replace($regexSymbols, '', $clean_text); // Match Transport And Map Symbols $regexTransport = '/[\x{1F680}-\x{1F6FF}]/u'; $clean_text = preg_replace($regexTransport, '', $clean_text); // Match Miscellaneous Symbols $regexMisc = '/[\x{2600}-\x{26FF}]/u'; $clean_text = preg_replace($regexMisc, '', $clean_text); // Match Dingbats $regexDingbats = '/[\x{2700}-\x{27BF}]/u'; $clean_text = preg_replace($regexDingbats, '', $clean_text); return $clean_text; } echo "\xF0\x9F\x98\x81"; echo removeEmoji("\xF0\x9F\x98\x81");
Output for 4.3.3 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.27, 8.3.0 - 8.3.15, 8.4.1 - 8.4.2
😁
Output for 4.3.0 - 4.3.2
😁 Warning: Compilation failed: characters with values > 255 are not yet supported in classes at offset 9 in /in/g5q3a on line 9 Warning: Compilation failed: characters with values > 255 are not yet supported in classes at offset 9 in /in/g5q3a on line 13 Warning: Compilation failed: characters with values > 255 are not yet supported in classes at offset 9 in /in/g5q3a on line 17 Warning: Compilation failed: characters with values > 255 are not yet supported in classes at offset 8 in /in/g5q3a on line 21 Warning: Compilation failed: characters with values > 255 are not yet supported in classes at offset 8 in /in/g5q3a on line 25

preferences:
46.56 ms | 408 KiB | 5 Q