3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = "Chap.2.#"; $range = array(); for ($i = 1; $i <= 4; $i++) { $range[$i] = $i; $n = 1 . $i; $range[$n] = $n; $n = 11 . $i; $range[$n] = $n; } sort($range); foreach ($range as $digit) { echo str_replace("#",$digit),"\n"; }
based on 8tD0s
Output for 5.3.0 - 7.3.0
Warning: str_replace() expects at least 3 parameters, 2 given in /in/poir0 on line 17 Warning: str_replace() expects at least 3 parameters, 2 given in /in/poir0 on line 17 Warning: str_replace() expects at least 3 parameters, 2 given in /in/poir0 on line 17 Warning: str_replace() expects at least 3 parameters, 2 given in /in/poir0 on line 17 Warning: str_replace() expects at least 3 parameters, 2 given in /in/poir0 on line 17 Warning: str_replace() expects at least 3 parameters, 2 given in /in/poir0 on line 17 Warning: str_replace() expects at least 3 parameters, 2 given in /in/poir0 on line 17 Warning: str_replace() expects at least 3 parameters, 2 given in /in/poir0 on line 17 Warning: str_replace() expects at least 3 parameters, 2 given in /in/poir0 on line 17 Warning: str_replace() expects at least 3 parameters, 2 given in /in/poir0 on line 17 Warning: str_replace() expects at least 3 parameters, 2 given in /in/poir0 on line 17 Warning: str_replace() expects at least 3 parameters, 2 given in /in/poir0 on line 17
Output for 4.3.0 - 5.2.17
Warning: Wrong parameter count for str_replace() in /in/poir0 on line 17 Warning: Wrong parameter count for str_replace() in /in/poir0 on line 17 Warning: Wrong parameter count for str_replace() in /in/poir0 on line 17 Warning: Wrong parameter count for str_replace() in /in/poir0 on line 17 Warning: Wrong parameter count for str_replace() in /in/poir0 on line 17 Warning: Wrong parameter count for str_replace() in /in/poir0 on line 17 Warning: Wrong parameter count for str_replace() in /in/poir0 on line 17 Warning: Wrong parameter count for str_replace() in /in/poir0 on line 17 Warning: Wrong parameter count for str_replace() in /in/poir0 on line 17 Warning: Wrong parameter count for str_replace() in /in/poir0 on line 17 Warning: Wrong parameter count for str_replace() in /in/poir0 on line 17 Warning: Wrong parameter count for str_replace() in /in/poir0 on line 17