3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $text = "01-3-567-90"; var_dump(strrpos($text, "-") , mb_strrpos($text, "-")); var_dump(strrpos($text, "-", 7) , mb_strrpos($text, "-", 7)); var_dump(strrpos($text, "-", -4), mb_strrpos($text, "-", -4));
Output for 5.2.4 - 7.2.0
int(8) int(8) int(8) int(8) int(4) int(4)
Output for 5.2.0 - 5.2.3
int(8) int(8) int(8) int(8) int(4) int(8)
Output for 5.0.0 - 5.1.6
int(8) int(8) Warning: mb_strrpos(): Unknown encoding "7" in /in/mCdGh on line 4 int(8) bool(false) Warning: mb_strrpos(): Unknown encoding "-4" in /in/mCdGh on line 5 int(4) bool(false)
Output for 4.3.2 - 4.4.9
int(8) int(8) Warning: Wrong parameter count for strrpos() in /in/mCdGh on line 4 Warning: mb_strrpos(): Unknown encoding "7" in /in/mCdGh on line 4 NULL bool(false) Warning: Wrong parameter count for strrpos() in /in/mCdGh on line 5 Warning: mb_strrpos(): Unknown encoding "-4" in /in/mCdGh on line 5 NULL bool(false)
Output for 4.3.0 - 4.3.1
int(8) int(8) Warning: Wrong parameter count for strrpos() in /in/mCdGh on line 4 Warning: mb_strrpos() [http://www.php.net/function.mb-strrpos]: Unknown encoding "7" in /in/mCdGh on line 4 NULL bool(false) Warning: Wrong parameter count for strrpos() in /in/mCdGh on line 5 Warning: mb_strrpos() [http://www.php.net/function.mb-strrpos]: Unknown encoding "-4" in /in/mCdGh on line 5 NULL bool(false)