3v4l.org

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