3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo preg_replace_callback("#%u([0-9A-F]{1,4})#i", create_function('$matches', 'return dec_to_utf8(hexdec($matches[1]));'), '%u01C4'); function dec_to_utf8($src) { $dest = ''; if($src < 0) { return false; } elseif($src <= 0x007f) { $dest .= chr($src); } elseif($src <= 0x07ff) { $dest .= chr(0xc0 | ($src >> 6)); $dest .= chr(0x80 | ($src & 0x003f)); } elseif($src <= 0xffff) { $dest .= chr(0xe0 | ($src >> 12)); $dest .= chr(0x80 | (($src >> 6) & 0x003f)); $dest .= chr(0x80 | ($src & 0x003f)); } elseif($src <= 0x10ffff) { $dest .= chr(0xf0 | ($src >> 18)); $dest .= chr(0x80 | (($src >> 12) & 0x3f)); $dest .= chr(0x80 | (($src >> 6) & 0x3f)); $dest .= chr(0x80 | ($src & 0x3f)); } else { // Out of range return false; } return $dest; }
based on kg07Q
Output for 7.2.0 - 7.3.1
Deprecated: Function create_function() is deprecated in /in/ghsKS on line 3 DŽ
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.1.25
DŽ