3v4l.org

run code in 200+ 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 - 7.2.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