3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo mb_detect_encoding('garcía'); print "\n"; echo mb_detect_encoding('García'); print "\n"; echo is_utf8('garcía'); print "\n"; echo is_utf8('García'); print "\n"; echo is_utf82('garcía'); print "\n"; echo is_utf82('García'); print "\n"; echo is_utf83('garcía'); print "\n"; echo is_utf83('García'); function is_utf8($str) { return (bool) preg_match('//u', $str); } function is_utf82($str) { return (bool) preg_match('!!u', $str); } function is_utf83($str) { return ! (false === mb_detect_encoding($str, 'UTF-8', true)); } $text = "m%y@email.coms"; echo 'Original : ', $text, PHP_EOL; echo 'TRANSLIT : ', iconv("UTF-8", "ISO-8859-1//TRANSLIT", $text), PHP_EOL; echo 'IGNORE : ', iconv("UTF-8", "ISO-8859-1//IGNORE", $text), PHP_EOL; echo 'Plain : ', iconv("UTF-8", "ISO-8859-1", $text), PHP_EOL;
Output for git.master, git.master_jit, rfc.property-hooks
UTF-8 UTF-8 1 1 1 1 1 1Original : m%y@email.coms TRANSLIT : Warning: iconv(): Wrong encoding, conversion from "UTF-8" to "ISO-8859-1//TRANSLIT" is not allowed in /in/rihQi on line 37 IGNORE : Warning: iconv(): Wrong encoding, conversion from "UTF-8" to "ISO-8859-1//IGNORE" is not allowed in /in/rihQi on line 38 Plain : Warning: iconv(): Wrong encoding, conversion from "UTF-8" to "ISO-8859-1" is not allowed in /in/rihQi on line 39

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
56.22 ms | 402 KiB | 8 Q