3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = range(1, 3); var_dump(current($arr)); foreach($arr as $val) { current($val); } var_dump(current($arr));
based on TYSs7
Output for 7.0.0 - 7.2.0
int(1) Warning: current() expects parameter 1 to be array, integer given in /in/5Xufe on line 5 Warning: current() expects parameter 1 to be array, integer given in /in/5Xufe on line 5 Warning: current() expects parameter 1 to be array, integer given in /in/5Xufe on line 5 int(1)
Output for 5.3.19 - 5.6.21
int(1) Warning: current() expects parameter 1 to be array, integer given in /in/5Xufe on line 5 Warning: current() expects parameter 1 to be array, integer given in /in/5Xufe on line 5 Warning: current() expects parameter 1 to be array, integer given in /in/5Xufe on line 5 bool(false)