3v4l.org

run code in 300+ PHP versions simultaneously
<?php function emoji_to_unicode($emoji) { if (mb_ord($emoji) < 256) return $emoji; $emoji = mb_convert_encoding($emoji, 'UTF-32', 'UTF-8'); $unicode = strtoupper(preg_replace("/^[0]{3}/","U+",bin2hex($emoji))); return $unicode; } $var = ("😀x😀hello"); $out = ''; for ($i = 0; $i < mb_strlen($var); $i++) { $out .= emoji_to_unicode(mb_substr($var, $i, 1)); } echo "$out\n";
Output for git.master, git.master_jit, rfc.property-hooks
U+1F600xU+1F600hello

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