3v4l.org

run code in 200+ PHP versions simultaneously
<?php $utf8string = 'ASCIIユーティーエッフ8hello123等々'; $var = 'hello123'; $pos = strpos($utf8string, $var,"UTF-8"); if ($pos!==false) { echo substr($utf8string, 0, $pos); }
Output for 7.3.0 - 7.4.1
Warning: strpos() expects parameter 3 to be int, string given in /in/PPZRn on line 6
Output for 7.0.0 - 7.2.26
Warning: strpos() expects parameter 3 to be integer, string given in /in/PPZRn on line 6
Output for 5.3.0 - 5.6.40
Warning: strpos() expects parameter 3 to be long, string given in /in/PPZRn on line 6
Output for 4.3.0 - 5.2.17
ASCIIユーティーエッフ8