3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(substr('πŸ˜€',0 ,1)); var_dump(mb_substr('πŸ˜€', 0 , 1)); preg_match('/test/', 'πŸ˜€test', $matches, PREG_OFFSET_CAPTURE); var_dump($matches);
based on RCSpR
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0beta1
string(1) "οΏ½" string(4) "πŸ˜€" array(1) { [0]=> array(2) { [0]=> string(4) "test" [1]=> int(4) } }