3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = ['x', 'y', 'z']; function array_fetch(array $a) { $element = current($a); var_dump($element); next($a); //echo $a; var_dump($element); return $element; } $a=array_fetch($array);
based on HjZt3
Output for 7.1.25 - 7.3.3
string(1) "x" string(1) "x"