3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = "sea \u{200B}\u{200B}lion"; echo preg_replace_callback('#\X#u', function($m) { $utf16 = mb_convert_encoding($m[0], 'UTF-16BE', 'UTF-8'); if (strlen($utf16) <= 2) { $esc = '\u' . bin2hex($utf16); } else { $esc = '\u' . bin2hex(substr($utf16, 0, 2)) . '\u' . bin2hex(substr($utf16, 2, 2)); } return $esc; }, $input);
Output for git.master, git.master_jit, rfc.property-hooks
\u0073\u0065\u0061\u0020\u200b\u200b\u006c\u0069\u006f\u006e

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