3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xs = array('y'); $ys = array(); foreach ($xs as $idX => $elemX) {} var_dump($idX, $elemX); foreach ($ys as $idY => $elemY) {} var_dump($idY, $elemY);
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
int(0) string(1) "y" Notice: Undefined variable: idY in /in/0cMDH on line 10 Notice: Undefined variable: elemY in /in/0cMDH on line 10 NULL NULL
Output for 4.3.0 - 5.0.3
int(0) string(1) "y" Notice: Undefined variable: idY in /in/0cMDH on line 10 Notice: Undefined variable: elemY in /in/0cMDH on line 10 NULL NULL