3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function str_multiple_replace($str, $needle, $subs) { return vsprintf(str_replace(array('%', $needle), array('%%', '%s'), $string), $subs); } $string = ">>>?<<<%%s>>>?<<<>>>?<<<"; echo str_multiple_replace($string, '?', array('Hello', 'World', '!'));
Output for 5.3.28 - 5.3.29, 5.4.20 - 7.2.0
Notice: Undefined variable: string in /in/Cdu4s on line 4
Output for 5.0.4 - 5.3.27, 5.4.0 - 5.4.19
Notice: Undefined variable: string in /in/0eVaR on line 4
Output for 4.3.1 - 5.0.3
Notice: Undefined variable: string in /in/0eVaR on line 4
Output for 4.3.0
Notice: Undefined variable: string in /in/Cdu4s on line 4