3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array(1 => 'a', 2 => 'b', 3 => 'c'); foreach($arr as $k => $v) { echo $k.$v; unset($v); var_dump($arr); } var_dump($arr);
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
1aarray(3) { [1]=> string(1) "a" [2]=> string(1) "b" [3]=> string(1) "c" } 2barray(3) { [1]=> string(1) "a" [2]=> string(1) "b" [3]=> string(1) "c" } 3carray(3) { [1]=> string(1) "a" [2]=> string(1) "b" [3]=> string(1) "c" } array(3) { [1]=> string(1) "a" [2]=> string(1) "b" [3]=> string(1) "c" }
Output for hhvm-3.10.0

Process exited with code 153.