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));
based on rEcG5
Output for 4.3.4 - 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/I1uZ4 on line 4 string(5) "UTF-8" Warning: mb_detect_encoding(): Illegal argument in /in/I1uZ4 on line 5 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/I1uZ4 on line 4 NULL Warning: Wrong parameter count for mb_detect_encoding() in /in/I1uZ4 on line 5 NULL Warning: Wrong parameter count for mb_detect_encoding() in /in/I1uZ4 on line 6 NULL