3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $test = "Hello 🤖"; $chop = substr($test, 0, 8); //Doh! This will crash almost all multibyte aware functions... $json = json_encode($chop); var_dump(json_last_error_msg(), $json);
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.0 - 7.2.6
string(56) "Malformed UTF-8 characters, possibly incorrectly encoded" bool(false)