3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = 'Le Courrier de Sáint-Hyácinthe'; if(!mb_check_encoding($content, 'UTF-8') OR !($content === mb_convert_encoding(mb_convert_encoding($content, 'UTF-32', 'UTF-8' ), 'UTF-8', 'UTF-32'))) { $content = mb_convert_encoding($content, 'UTF-8'); } echo mb_strtoupper($content);

preferences:
34.22 ms | 402 KiB | 5 Q