3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = array(); $arr['a'] = 123; $arr['f'] = 345; $arr['b'] = 678; var_dump($arr); var_dump($arr[0]); var_dump($arr[1]); var_dump($arr[2]);
Output for 5.3.0 - 7.2.0
array(3) { ["a"]=> int(123) ["f"]=> int(345) ["b"]=> int(678) } Notice: Undefined offset: 0 in /in/YvEl2 on line 9 NULL Notice: Undefined offset: 1 in /in/YvEl2 on line 10 NULL Notice: Undefined offset: 2 in /in/YvEl2 on line 11 NULL
Output for 4.3.0 - 5.2.17
array(3) { ["a"]=> int(123) ["f"]=> int(345) ["b"]=> int(678) } Notice: Undefined offset: 0 in /in/YvEl2 on line 9 NULL Notice: Undefined offset: 1 in /in/YvEl2 on line 10 NULL Notice: Undefined offset: 2 in /in/YvEl2 on line 11 NULL