3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = array('foo', 'bar'); $result = NULL; foreach ($arr as $key => $val) $result = $val; var_dump($result); var_dump(end($arr));
based on JCj4q
Output for 4.3.0 - 7.3.1
string(3) "bar" string(3) "bar"