3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = new ArrayObject(); $b = array(); $a[null]['hurr'] = 'durr'; var_dump($a['epic_magic']); var_dump($b['epic_magic']); var_dump($c['epic_magic']); // Undefined var!! $d = []; var_dump($a['epic_magic']); // more magic! var_dump($d['epic_magic']); $e = 'srsly?'; var_dump($a['epic_magic']); // srsly. var_dump($aaa); var_dump($aaa->output);
Output for 5.4.8 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined index: epic_magic in /in/CNPR2 on line 9 NULL Notice: Undefined index: epic_magic in /in/CNPR2 on line 10 NULL Notice: Undefined variable: c in /in/CNPR2 on line 11 NULL Notice: Undefined index: epic_magic in /in/CNPR2 on line 14 NULL Notice: Undefined index: epic_magic in /in/CNPR2 on line 15 NULL Notice: Undefined index: epic_magic in /in/CNPR2 on line 18 NULL Notice: Undefined variable: aaa in /in/CNPR2 on line 20 NULL Notice: Undefined variable: aaa in /in/CNPR2 on line 21 Notice: Trying to get property of non-object in /in/CNPR2 on line 21 NULL
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined index: epic_magic in /in/CNPR2 on line 9 NULL Notice: Undefined index: epic_magic in /in/CNPR2 on line 10 NULL Notice: Undefined variable: c in /in/CNPR2 on line 11 NULL Notice: Undefined index: epic_magic in /in/CNPR2 on line 14 NULL Notice: Undefined index: epic_magic in /in/CNPR2 on line 15 NULL Notice: Undefined index: epic_magic in /in/CNPR2 on line 18 NULL Notice: Undefined variable: aaa in /in/CNPR2 on line 20 NULL Notice: Undefined variable: aaa in /in/CNPR2 on line 21 Notice: Cannot access property on non-object in /in/CNPR2 on line 21 NULL
Output for 5.4.0 - 5.4.7
Warning: Illegal offset type in /in/CNPR2 on line 7 Notice: Undefined index: epic_magic in /in/CNPR2 on line 9 array(1) { ["hurr"]=> string(4) "durr" } Notice: Undefined index: epic_magic in /in/CNPR2 on line 10 array(1) { ["hurr"]=> string(4) "durr" } Notice: Undefined variable: c in /in/CNPR2 on line 11 Notice: Undefined index: epic_magic in /in/CNPR2 on line 11 array(1) { ["hurr"]=> string(4) "durr" } Notice: Undefined index: epic_magic in /in/CNPR2 on line 14 array(0) { } Notice: Undefined index: epic_magic in /in/CNPR2 on line 15 array(0) { } Notice: Undefined index: epic_magic in /in/CNPR2 on line 18 string(6) "srsly?" Notice: Undefined variable: aaa in /in/CNPR2 on line 20 string(6) "srsly?" Notice: Undefined variable: aaa in /in/CNPR2 on line 21 Notice: Trying to get property of non-object in /in/CNPR2 on line 21 NULL
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/CNPR2 on line 13
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/CNPR2 on line 13
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/CNPR2 on line 13
Process exited with code 255.