3v4l.org

run code in 150+ 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 - 5.6.28, 7.0.0 - 7.1.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 hhvm-3.10.0 - 3.12.0
array(3) { ["a"]=> int(123) ["f"]=> int(345) ["b"]=> int(678) } Notice: Undefined index: 0 in /in/YvEl2 on line 9 NULL Notice: Undefined index: 1 in /in/YvEl2 on line 10 NULL Notice: Undefined index: 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