3v4l.org

run code in 300+ PHP versions simultaneously
<?php function uord($str) { $arr = ($str = unpack('C*', substr($str, 0, 4))) ? $str[1] : 0; if (0xF0 <= $arr) return (($arr - 0xF0)<<18) + (($str[2] - 0x80)<<12) + (($str[3] - 0x80)<<6) + $str[4] - 0x80; if (0xE0 <= $arr) return (($arr - 0xE0)<<12) + (($str[2] - 0x80)<<6) + $str[3] - 0x80; if (0xC0 <= $arr) return (($arr - 0xC0)<<6) + $str[2] - 0x80; return $arr; } function uchr ($codes) { if (is_scalar($codes)) $codes = func_get_args(); $str = ''; foreach ($codes as $code) $str .= html_entity_decode('&#'.$code.';',ENT_NOQUOTES,'UTF-8'); return $str; } $str = "Düsseldorf ist scheiße!"; print_r(uord($str[0])); echo '<br/>'; print_r(uord($str[1])); echo '<br/>'; echo uchr(23383); echo '<br/>'; echo uchr(23383,215,23383); echo '<br/>'; echo uchr(array(23383,215,23383,215,23383)); echo '<br/>';
Output for git.master, git.master_jit, rfc.property-hooks
68<br/> Warning: Undefined array key 2 in /in/YZEgP on line 8 64<br/>字<br/>字×字<br/>字×字×字<br/>

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:
38.29 ms | 401 KiB | 8 Q