3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $mystring = 'vabcsa'; $findme = 'a'; $pos = strpos($mystring, $findme,-1); if ($pos !== false) { echo "The string '$findme' was found in the string '$mystring'"; echo " and exists at position $pos"; } else { echo "The string '$findme' was not found in the string '$mystring'"; }
Output for 7.1.0
The string 'a' was found in the string 'vabcsa' and exists at position 5
Output for 5.2.5 - 7.0.14
Warning: strpos(): Offset not contained in string in /in/RHYUY on line 4 The string 'a' was not found in the string 'vabcsa'
Output for 4.3.2 - 5.2.4
Warning: strpos(): Offset not contained in string. in /in/RHYUY on line 4 The string 'a' was not found in the string 'vabcsa'
Output for 4.3.0 - 4.3.1
Warning: strpos() [http://www.php.net/function.strpos]: Offset not contained in string. in /in/RHYUY on line 4 The string 'a' was not found in the string 'vabcsa'