3v4l.org

run code in 200+ 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 - 7.2.0
string(1) "A" string(1) "B" string(1) "C" string(1) "D" array(1) { [0]=> string(1) "A" }