3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $pos = strrpos($mystring, "b"); if ($pos === false) { // note: three equal signs echo "not found..."; } $pos = strrpos($mystring, "b"); if ($pos === false) { // note: three equal signs echo "not found..."; } $foo = "0123456789a123456789b123456789c"; var_dump(strrpos($foo, '7', -5)); // Starts looking backwards five positions // from the end. Result: int(17) var_dump(strrpos($foo, '7', 20)); // Starts searching 20 positions into the // string. Result: int(27) var_dump(strrpos($foo, '7', 28)); // Result: bool(false)
Output for 5.0.4 - 5.0.5, 5.1.1 - 5.6.28, hhvm-3.10.0, 7.0.0 - 7.1.0
Notice: Undefined variable: mystring in /in/5LKVQ on line 4 not found... Notice: Undefined variable: mystring in /in/5LKVQ on line 10 not found...int(17) int(27) bool(false)
Output for hhvm-3.12.0
Notice: Undefined variable: mystring in /in/5LKVQ on line 4 Warning: strrpos() expects parameter 1 to be string, null given in /in/5LKVQ on line 4 Notice: Undefined variable: mystring in /in/5LKVQ on line 10 Warning: strrpos() expects parameter 1 to be string, null given in /in/5LKVQ on line 10 int(17) int(27) bool(false)
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/5LKVQ on line 23
Process exited with code 255.
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: mystring in /in/5LKVQ on line 4 not found... Notice: Undefined variable: mystring in /in/5LKVQ on line 10 not found...int(17) int(27) bool(false)
Output for 4.3.0 - 4.4.9
Notice: Undefined variable: mystring in /in/5LKVQ on line 4 not found... Notice: Undefined variable: mystring in /in/5LKVQ on line 10 not found... Warning: Wrong parameter count for strrpos() in /in/5LKVQ on line 17 NULL Warning: Wrong parameter count for strrpos() in /in/5LKVQ on line 20 NULL Warning: Wrong parameter count for strrpos() in /in/5LKVQ on line 23 NULL