3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array(10, 20); foreach($a as $v) { var_dump($a); var_dump($v); $a[1] = 30; } var_dump($v);
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
array(2) { [0]=> int(10) [1]=> int(20) } int(10) array(2) { [0]=> int(10) [1]=> int(30) } int(20) int(20)
Output for hhvm-3.10.0

Process exited with code 153.