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 = array(); var_dump($a['epic_magic']); // more magic! var_dump($d['epic_magic']); $e = 'srsly?'; var_dump($a['epic_magic']); // srsly.
Output for 5.4.8 - 7.1.0
Notice: Undefined index: epic_magic in /in/2UOYo on line 9 NULL Notice: Undefined index: epic_magic in /in/2UOYo on line 10 NULL Notice: Undefined variable: c in /in/2UOYo on line 11 NULL Notice: Undefined index: epic_magic in /in/2UOYo on line 14 NULL Notice: Undefined index: epic_magic in /in/2UOYo on line 15 NULL Notice: Undefined index: epic_magic in /in/2UOYo on line 18 NULL
Output for 5.3.0 - 5.3.17, 5.4.0 - 5.4.7
Warning: Illegal offset type in /in/2UOYo on line 7 Notice: Undefined index: epic_magic in /in/2UOYo on line 9 array(1) { ["hurr"]=> string(4) "durr" } Notice: Undefined index: epic_magic in /in/2UOYo on line 10 array(1) { ["hurr"]=> string(4) "durr" } Notice: Undefined variable: c in /in/2UOYo on line 11 Notice: Undefined index: epic_magic in /in/2UOYo on line 11 array(1) { ["hurr"]=> string(4) "durr" } Notice: Undefined index: epic_magic in /in/2UOYo on line 14 array(0) { } Notice: Undefined index: epic_magic in /in/2UOYo on line 15 array(0) { } Notice: Undefined index: epic_magic in /in/2UOYo on line 18 string(6) "srsly?"
Output for 5.3.18 - 5.3.29
Notice: Undefined index: epic_magic in /in/2UOYo on line 9 NULL Notice: Undefined index: epic_magic in /in/2UOYo on line 10 NULL Notice: Undefined variable: c in /in/2UOYo on line 11 NULL Notice: Undefined index: epic_magic in /in/2UOYo on line 14 NULL Notice: Undefined index: epic_magic in /in/2UOYo on line 15 NULL Notice: Undefined index: epic_magic in /in/2UOYo on line 18 NULL
Output for 5.2.0 - 5.2.17
Warning: Illegal offset type in /in/2UOYo on line 7 Notice: Undefined index: epic_magic in /in/2UOYo on line 9 array(1) { ["hurr"]=> string(4) "durr" } Notice: Undefined index: epic_magic in /in/2UOYo on line 10 array(1) { ["hurr"]=> string(4) "durr" } Notice: Undefined variable: c in /in/2UOYo on line 11 Notice: Undefined index: epic_magic in /in/2UOYo on line 11 array(1) { ["hurr"]=> string(4) "durr" } Notice: Undefined index: epic_magic in /in/2UOYo on line 14 array(1) { ["hurr"]=> string(4) "durr" } Notice: Undefined index: epic_magic in /in/2UOYo on line 15 array(1) { ["hurr"]=> string(4) "durr" } Notice: Undefined index: epic_magic in /in/2UOYo on line 18 array(1) { ["hurr"]=> string(4) "durr" }
Output for 5.0.0 - 5.0.5, 5.1.1 - 5.1.6
Warning: Illegal offset type in /in/2UOYo on line 7 Fatal error: Objects used as arrays in post/pre increment/decrement must return values by reference in /in/2UOYo on line 7
Process exited with code 255.
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/2UOYo on line 18
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: arrayobject in /in/2UOYo on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: arrayobject in /in/2UOYo on line 3