3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $id=array(1,2,3); $age = array(); $age[$id]="35"; $age[$id]="37"; $age[$id]="43"; echo $age[$id[0]];
based on F2IiZ
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: Illegal offset type in /in/FTYI4 on line 4 Warning: Illegal offset type in /in/FTYI4 on line 5 Warning: Illegal offset type in /in/FTYI4 on line 6 Notice: Undefined offset: 1 in /in/FTYI4 on line 8
Output for hhvm-3.10.0 - 3.12.0
Warning: Illegal offset type in /in/FTYI4 on line 4 Warning: Illegal offset type in /in/FTYI4 on line 5 Warning: Illegal offset type in /in/FTYI4 on line 6 Notice: Undefined index: 1 in /in/FTYI4 on line 8
Output for 4.3.0 - 5.2.17
Warning: Illegal offset type in /in/FTYI4 on line 4 Warning: Illegal offset type in /in/FTYI4 on line 5 Warning: Illegal offset type in /in/FTYI4 on line 6 Notice: Undefined offset: 1 in /in/FTYI4 on line 8