3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function unicode_decode($str){ return preg_replace("/\\\u([0-9A-F]{4})/ie", "iconv('utf-16', 'utf-8',hex2str(\"$1\"))", $str); } function hex2str($hex) { $r = ''; for ($i = 0; $i < strlen($hex) - 1; $i += 2) $r .= chr(hexdec($hex[$i] . $hex[$i + 1])); return $r; } $var="\u092e\u0941\u0930\u0932\u0940 \u0938\u093e\u0930"; $var = unicode_decode($var); echo $var; ?>
Output for 7.0.0 - 7.1.0
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /in/58lWg on line 5
Output for 5.0.0 - 5.4.45, hhvm-3.10.0 - 3.12.0
⸉䄉〉㈉䀉 㠉㸉〉
Output for 5.5.24 - 5.5.34, 5.6.7 - 5.6.20, 5.6.28
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /in/58lWg on line 5 ⸉䄉〉㈉䀉 㠉㸉〉
Output for 5.5.35, 5.6.21
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /in/58lWg on line 5 Fatal error: Call to undefined function iconv() in /in/58lWg(5) : regexp code on line 1
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: iconv() in /in/Bt1i4(5) : regexp code on line 1
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: iconv() in /in/Bt1i4(5) : regexp code on line 1
Process exited with code 255.
Output for 4.3.1
Fatal error: Call to undefined function: iconv() in /in/Bt1i4(5) : regexp code on line 1
Output for 4.3.0
Fatal error: Call to undefined function: iconv() in /in/58lWg(5) : regexp code on line 1