3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $text = "%u0423%u0432%u0430%u0436%u0430%u0435%u043C%u044B%u0435"; //script from http://zizi.kxup.com/ //javascript unesape function unescape($str) { $str = rawurldecode($str); preg_match_all("/(?:%u.{4})|&#x.{4};|&#\d+;|.+/U",$str,$r); $ar = $r[0]; print_r($ar); foreach($ar as $k=>$v) { if(substr($v,0,2) == "%u") $ar[$k] = iconv("UCS-2","UTF-8",pack("H4",substr($v,-4))); elseif(substr($v,0,3) == "&#x") $ar[$k] = iconv("UCS-2","UTF-8",pack("H4",substr($v,3,-1))); elseif(substr($v,0,2) == "&#") { echo substr($v,2,-1)."<br>"; $ar[$k] = iconv("UCS-2","UTF-8",pack("n",substr($v,2,-1))); } } return join("",$ar); } echo unescape($text) ?>
Output for 5.0.0 - 5.5.34, 5.6.0 - 5.6.20, 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.0.5, 7.0.14 - 7.1.0
Array ( [0] => %u0423 [1] => %u0432 [2] => %u0430 [3] => %u0436 [4] => %u0430 [5] => %u0435 [6] => %u043C [7] => %u044B [8] => %u0435 ) ⌄㈄〄㘄〄㔄㰄䬄㔄
Output for 7.0.6 - 7.0.8
Array ( [0] => %u0423 [1] => %u0432 [2] => %u0430 [3] => %u0436 [4] => %u0430 [5] => %u0435 [6] => %u043C [7] => %u044B [8] => %u0435 ) Fatal error: Uncaught Error: Call to undefined function iconv() in /in/B6vNv:12 Stack trace: #0 /in/B6vNv(22): unescape('%u0423%u0432%u0...') #1 {main} thrown in /in/B6vNv on line 12
Process exited with code 255.
Output for 5.5.35 - 5.5.37, 5.6.21 - 5.6.23
Array ( [0] => %u0423 [1] => %u0432 [2] => %u0430 [3] => %u0436 [4] => %u0430 [5] => %u0435 [6] => %u043C [7] => %u044B [8] => %u0435 ) Fatal error: Call to undefined function iconv() in /in/B6vNv on line 12
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Array ( [0] => %u0423 [1] => %u0432 [2] => %u0430 [3] => %u0436 [4] => %u0430 [5] => %u0435 [6] => %u043C [7] => %u044B [8] => %u0435 ) Fatal error: Call to undefined function: iconv() in /in/B6vNv on line 12
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Array ( [0] => %u0423 [1] => %u0432 [2] => %u0430 [3] => %u0436 [4] => %u0430 [5] => %u0435 [6] => %u043C [7] => %u044B [8] => %u0435 ) Fatal error: Call to undefined function: iconv() in /in/B6vNv on line 12
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Array ( [0] => %u0423 [1] => %u0432 [2] => %u0430 [3] => %u0436 [4] => %u0430 [5] => %u0435 [6] => %u043C [7] => %u044B [8] => %u0435 ) Fatal error: Call to undefined function: iconv() in /in/B6vNv on line 12