3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php error_reporting(-1); var_dump(substr_replace(array("x", "y"), array(), array(), 0)); var_dump(substr_replace(array("x", "y"), array(), 0, array())); var_dump(substr_replace(array("x", "y"), 0, array(), array())); var_dump(substr_replace(array("x", "y"), 0, array(), 0));
Output for 5.0.0 - 7.1.0
array(2) { [0]=> string(1) "x" [1]=> string(1) "y" } array(2) { [0]=> string(0) "" [1]=> string(0) "" } array(2) { [0]=> string(1) "0" [1]=> string(1) "0" } array(2) { [0]=> string(2) "0x" [1]=> string(2) "0y" }
Output for 4.3.0 - 4.4.9
Notice: Array to string conversion in /in/vnrWb on line 3 Notice: Array to string conversion in /in/vnrWb on line 3 string(10) "ArrayArray" Notice: Array to string conversion in /in/vnrWb on line 4 Notice: Array to string conversion in /in/vnrWb on line 4 string(10) "ArrayArray" Notice: Array to string conversion in /in/vnrWb on line 5 string(6) "0Array" Notice: Array to string conversion in /in/vnrWb on line 6 string(6) "0Array"