3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function dostuff() { echo 'mb_check_encoding: '; if ( function_exists( 'mb_check_encoding' ) ) { var_dump( mb_check_encoding( "\xF4\x90\x80\x80", 'UTF-8' ) ); } else { echo "absent\n"; } echo 'preg_match: '; if ( function_exists( 'preg_match' ) ) { var_dump(preg_match( '//u', "\xF4\x90\x80\x80" )); } else { echo "absent\n"; } } dostuff();
Output for 5.4.0 - 7.1.0
mb_check_encoding: bool(false) preg_match: bool(false)
Output for 5.3.4 - 5.3.29
mb_check_encoding: bool(true) preg_match: bool(false)
Output for 4.4.9, 5.2.5 - 5.3.3
mb_check_encoding: bool(true) preg_match: int(0)
Output for 4.4.3 - 4.4.8, 5.1.3 - 5.2.4
mb_check_encoding: bool(true) preg_match: int(1)
Output for 4.3.0 - 4.4.2, 5.0.0 - 5.1.2
mb_check_encoding: absent preg_match: int(1)