3v4l.org

run code in 300+ PHP versions simultaneously
// Source - https://stackoverflow.com/q/79908777 // Posted by Sarah // Retrieved 2026-03-16, License - CC BY-SA 4.0 <?php $myString = "\x65\x92"; $isValidEncoding = mb_check_encoding($myString, 'UTF-8'); if(!$isValidEncoding){ //This code does successfully execute //since the string is not utf-8 encoding. echo "Invalid Encoding!"; } ?>

preferences:
48.19 ms | 713 KiB | 5 Q