3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str2 = "占楼"; var_dump(mb_detect_encoding($str2, 'CP936', true)); var_dump(mb_detect_encoding($str2, 'EUC-CN', true)); var_dump(mb_detect_encoding($str2, 'UTF-8', true));
Output for 4.3.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(5) "CP936" bool(false) string(5) "UTF-8"
Output for 4.3.3
Warning: mb_detect_encoding(): Illegal argument in /in/Wm4kL on line 3 string(5) "UTF-8" Warning: mb_detect_encoding(): Illegal argument in /in/Wm4kL on line 4 string(5) "UTF-8" string(5) "UTF-8"
Output for 4.3.0 - 4.3.2
Warning: Wrong parameter count for mb_detect_encoding() in /in/Wm4kL on line 3 NULL Warning: Wrong parameter count for mb_detect_encoding() in /in/Wm4kL on line 4 NULL Warning: Wrong parameter count for mb_detect_encoding() in /in/Wm4kL on line 5 NULL