3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function mystr_replace($needle,$replace,$haystack,$count=null){ $args = func_get_args(); return call_user_func_array('str_replace',$args); } echo mystr_replace("frop","frml","frop",1);
based on RZq5I
Output for hhvm-3.10.0 - 3.12.0, 7.1.0
Warning: Parameter 4 to str_replace() expected to be a reference, value given in /in/YqUot on line 4 frml
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.0.14
Warning: Parameter 4 to str_replace() expected to be a reference, value given in /in/YqUot on line 4
Output for 4.3.0 - 4.3.1, 5.0.0 - 5.2.17
frml
Output for 4.3.2 - 4.4.9
Warning: Wrong parameter count for str_replace() in /in/YqUot on line 4