3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = [1, 2, 3, 4, 5]; foreach ($array as $value) { echo $value . ' - ' . current($array) . "\n"; }
based on GAaCf
Output for 7.0.0 - 7.2.0
1 - 1 2 - 1 3 - 1 4 - 1 5 - 1
Output for 5.5.0 - 5.6.28
1 - 2 2 - 2 3 - 2 4 - 2 5 - 2