3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $list = array('A', 'B', 'C', 'D'); foreach ($list as $key => $val) { var_dump($val); unset($list[1], $list[2], $list[3]); } echo var_dump($list);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(1) "A" string(1) "B" string(1) "C" string(1) "D" array(1) { [0]=> string(1) "A" }