3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = array( 'a' => 'A', 'b' => 'B', 'c' => 'C'); var_dump($arr); foreach ($arr as &$val) { if ($val == 'B') { unset($val); } } var_dump($arr); foreach ($arr as &$val) { if ($val == 'B') { $val = 'X'; } } var_dump($arr);