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($string, 'UTF-8', true)); }
Output for git.master, git.master_jit, rfc.property-hooks
UTF-8 UTF-8 1 1 1 1 Warning: Undefined variable $string in /in/ePkCf on line 30 Deprecated: mb_detect_encoding(): Passing null to parameter #1 ($string) of type string is deprecated in /in/ePkCf on line 30 1 Warning: Undefined variable $string in /in/ePkCf on line 30 Deprecated: mb_detect_encoding(): Passing null to parameter #1 ($string) of type string is deprecated in /in/ePkCf on line 30 1

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:
53.86 ms | 402 KiB | 8 Q