3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php /* Detect character encoding with current detect_order */ echo mb_detect_encoding($str); /* "auto" is expanded according to mbstring.language */ echo mb_detect_encoding($str, "auto"); /* Specify encoding_list character encoding by comma separated list */ echo mb_detect_encoding($str, "JIS, eucjp-win, sjis-win"); /* Use array to specify encoding_list */ $ary[] = "ASCII"; $ary[] = "JIS"; $ary[] = "EUC-JP"; echo mb_detect_encoding($str, $ary);
Output for 5.0.4 - 5.6.28, hhvm-3.10.0, 7.0.0 - 7.1.0
Notice: Undefined variable: str in /in/vIohQ on line 3 ASCII Notice: Undefined variable: str in /in/vIohQ on line 6 ASCII Notice: Undefined variable: str in /in/vIohQ on line 9 JIS Notice: Undefined variable: str in /in/vIohQ on line 15 ASCII
Output for hhvm-3.12.0
Notice: Undefined variable: str in /in/vIohQ on line 3 Warning: mb_detect_encoding() expects parameter 1 to be string, null given in /in/vIohQ on line 3 Notice: Undefined variable: str in /in/vIohQ on line 6 Warning: mb_detect_encoding() expects parameter 1 to be string, null given in /in/vIohQ on line 6 Notice: Undefined variable: str in /in/vIohQ on line 9 Warning: mb_detect_encoding() expects parameter 1 to be string, null given in /in/vIohQ on line 9 Notice: Undefined variable: str in /in/vIohQ on line 15 Warning: mb_detect_encoding() expects parameter 1 to be string, null given in /in/vIohQ on line 15
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: str in /in/vIohQ on line 3 ASCII Notice: Undefined variable: str in /in/vIohQ on line 6 ASCII Notice: Undefined variable: str in /in/vIohQ on line 9 JIS Notice: Undefined variable: str in /in/vIohQ on line 15 ASCII