3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = array(1 => "Hello"); var_dump($arr); $x = "fun_arr"; function fun_arr($i) { global $arr; return $arr[i]; } echo $x(1);
Output for 5.3.0 - 7.1.7
array(1) { [1]=> string(5) "Hello" } Notice: Use of undefined constant i - assumed 'i' in /in/HQ1MM on line 13 Notice: Undefined index: i in /in/HQ1MM on line 13
Output for 4.3.0 - 5.2.17
array(1) { [1]=> string(5) "Hello" } Notice: Use of undefined constant i - assumed 'i' in /in/HQ1MM on line 13 Notice: Undefined index: i in /in/HQ1MM on line 13