3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $url = "http://www.foo.com/parentfoo/childfoo/"; $last = strrpos($url, '/'); if ($last === false) { return false; } $next_to_last = strrpos($url, '/', $last - strlen($url) - 1, 1); $var1 = substr_replace($url,"",$last); echo $var2 = substr_replace($var1,"#",$next_to_last,1);
Output for 5.0.0 - 7.1.0
Warning: strrpos() expects at most 3 parameters, 4 given in /in/a69HX on line 9 #ttp://www.foo.com/parentfoo/childfoo
Output for 4.3.0 - 4.4.9
Warning: Wrong parameter count for strrpos() in /in/a69HX on line 9 #ttp://www.foo.com/parentfoo/childfoo