3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = [0, 1, 2]; $b = ["Nula", "Jedna", "Dva"]; var_dump($a); str_replace($a, $b, "1"); var_dump($a);
Output for 5.4.11 - 5.6.28, 7.0.3 - 7.2.0
array(3) { [0]=> int(0) [1]=> int(1) [2]=> int(2) } array(3) { [0]=> int(0) [1]=> int(1) [2]=> int(2) }
Output for 7.0.0 - 7.0.2
array(3) { [0]=> int(0) [1]=> int(1) [2]=> int(2) } array(3) { [0]=> string(1) "0" [1]=> string(1) "1" [2]=> string(1) "2" }
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/6icnd on line 3
Process exited with code 255.