3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array( array(), ); $rec = &$a[0]; var_dump(str_replace("2", "3", $a));
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.29, 8.2.0 - 8.2.21, 8.3.0 - 8.3.9
Warning: Array to string conversion in /in/25ahu on line 6 array(1) { [0]=> string(5) "Array" }
Output for 5.5.0 - 5.5.35, 5.6.0 - 5.6.28, 7.0.6 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
array(1) { [0]=> array(0) { } }
Output for 7.0.0 - 7.0.5
Notice: Array to string conversion in /in/25ahu on line 6 array(1) { [0]=> string(5) "Array" }

preferences:
208.56 ms | 402 KiB | 266 Q