3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $test = array(); $test['a'] = 'first'; $test['d'] = 'second'; $test['c'] = 'third'; $test['e'] = 'penultimate'; $test['b'] = 'last'; foreach($array as $key => $value) { var_dump($value); }
based on RqtTE
Output for 5.1.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: array in /in/t6PsH on line 12 Warning: Invalid argument supplied for foreach() in /in/t6PsH on line 12
Output for hhvm-3.10.0 - 3.13.2
Notice: Undefined variable: array in /in/t6PsH on line 14 Warning: Invalid argument supplied for foreach() in /in/t6PsH on line 14
Output for 4.3.0 - 4.3.10, 4.4.0 - 5.0.5
Warning: Invalid argument supplied for foreach() in /in/t6PsH on line 12
Output for 4.3.11