3v4l.org

run code in 300+ PHP versions simultaneously
<?php function html_asciify(string $utf8String): string { $iterator = IntlBreakIterator::createCodePointInstance(); $iterator->setText($utf8String); $result = ''; foreach ($iterator as $pos) { if ($pos === 0) { continue; } $codePoint = $iterator->getLastCodePoint(); $result .= $codePoint <= 127 ? chr($codePoint) : '&#x' . dechex($codePoint) . ';'; } return $result; } $result = html_asciify("aaaååddd仕事bbbb\x80aaaa"); var_dump($result, html_entity_decode($result));
Output for git.master, git.master_jit, rfc.property-hooks
string(50) "aaa&#xe5;&#xe5;ddd&#x4ed5;&#x4e8b;bbbb&#xfffd;aaaa" string(27) "aaaååddd仕事bbbb�aaaa"

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:
109.51 ms | 405 KiB | 5 Q