3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php //$utf8string = '测试杂志hello123等々'; $utf8string = '测试杂志'; //$utf8string = mb_substr('测试杂志', 0, 2, 'UTF-8'); $utf8string = mb_substr('Hello How are you志', 0, 2, 'UTF-8'); echo $utf8string; //$var = 'hello123'; //$pos = strpos($utf8string, $var); //if ($pos!==false) { //echo substr($utf8string, 0, 10); //}
based on dNTpj
Output for 4.3.0 - 4.4.1, 4.4.3 - 5.0.5, 5.1.1, 5.1.3 - 5.1.4, 5.1.6 - 7.2.0
He
Output for 4.4.2, 5.1.2, 5.1.5
//}He
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/ngZF5 on line 13
Process exited with code 255.