3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = [1]; var_dump($a); foreach ($a as $v) { echo('Array points to: ' . current($a) . ' foreach() is at element: ' . $v . PHP_EOL); } echo('After loop array points to: ' . current($a));
Output for 5.6.19
array(1) { [0]=> int(1) } Array points to: 1 foreach() is at element: 1 After loop array points to: 1