3v4l.org

run code in 300+ PHP versions simultaneously
<?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();

preferences:
35.05 ms | 402 KiB | 5 Q