3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '回';echo $str{0};echo urlencode($str); echo $bin = pack("C3", ord($str{0}), ord($str{1}), ord($str{2}));//回 $hex = strtoupper(bin2hex($bin)); echo "UTF-8编码: " . $hex . "\n"; $byte1 = ord($str{0}); $byte2 = ord($str{1}); $byte3 = ord($str{2}); $c1 = (($byte1 & 0x0F) << 4) | (($byte2 & 0x3F) >> 2); $c2 = (($byte2 & 0x03) << 6) | ($byte3 & 0x3F); $dec = (($c1 & 0x00FF) << 8) | $c2; echo "Unicode编码: " . $dec . "\n";
Output for git.master, git.master_jit
Fatal error: Array and string offset access syntax with curly braces is no longer supported in /in/PhE3b on line 3
Process exited with code 255.
Output for rfc.property-hooks
Parse error: syntax error, unexpected token "{", expecting "," or ";" in /in/PhE3b on line 3
Process exited with code 255.

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