3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $ascii = 'foo'; var_dump(mb_check_encoding($ascii, 'UTF-8')); var_dump(mb_check_encoding($ascii, 'ASCII')); $utf8 = 'Österreich'; var_dump(mb_check_encoding($utf8, 'UTF-8')); var_dump(mb_check_encoding($utf8, 'ASCII')); $jp = '日本語'; var_dump(mb_check_encoding($jp, 'UTF-8')); var_dump(mb_check_encoding($jp, 'ASCII'));
based on 3sopk
Output for 4.4.3 - 4.4.9, 5.1.3 - 7.2.0
bool(true) bool(true) bool(true) bool(false) bool(true) bool(false)
Output for 5.0.0 - 5.1.2
Fatal error: Call to undefined function mb_check_encoding() in /in/6QiFu on line 5
Process exited with code 255.
Output for 4.3.2 - 4.4.2
Fatal error: Call to undefined function: mb_check_encoding() in /in/6QiFu on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: mb_check_encoding() in /in/6QiFu on line 5