3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $some_string = "Ку ку"; $arra_c = array( "UTF-8", "ASCII", "ISO-8859-1", "ISO-8859-2", "ISO-8859-3", "ISO-8859-4", "ISO-8859-6", "ISO-8859-7", "ISO-8859-8", "ISO-8859-9", "ISO-8859-10", "ISO-8859-13", "ISO-8859-14", "ISO-8859-15", "EUC-TW", "CP950", "BIG-5", "Windows-1252",// (CP1252)); foreach($arra_c as $k => $v){ var_dump(mb_convert_encoding($some_string,$v,"UTF-8" ). "-" . $v ." # ". strlen(json_encode(array('message' => mb_convert_encoding($some_string,$v,"UTF-8" ))))); } //var_dump(mb_detect_encoding($some_string)); //var_dump(strlen(json_encode(array('message' => $some_string))));
Output for 5.4.0 - 5.4.25
Parse error: syntax error, unexpected 'foreach' (T_FOREACH), expecting ')' in /in/fCGeg on line 25
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_FOREACH, expecting ')' in /in/fCGeg on line 25
Process exited with code 255.