3v4l.org

run code in 300+ PHP versions simultaneously
<?php function doIt($string, $charset) { echo mb_strtoupper(mb_substr($string, 0, 1, $charset), $charset).mb_strtolower(mb_substr($string, 1, null, $charset), $charset), "\n"; } doIt('abcd', 'UTF-8'); doIt('abcd', 'ASCII'); doIt('abcd', 'ISO-8859-15');

preferences:
34.87 ms | 402 KiB | 5 Q