3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function ref(&$a) {} function val($a) {} $b = []; $c = 'hi'; $a = $$c['a']['b']; $a =& $$c['a']['b']; val($$c['a']['b']); ref($$c['a']['b']); valn($b['a']['b']); $a = $b['a']['b']; $a =& $b['a']['b']; val($b['a']['b']); ref($b['a']['b']); valn($b['a']['b']);
based on gLJU8
Output for 7.0.0 - 7.2.0
Notice: Undefined variable: hi in /in/qOgME on line 8 Fatal error: Uncaught Error: Call to undefined function valn() in /in/qOgME:13 Stack trace: #0 {main} thrown in /in/qOgME on line 13
Process exited with code 255.
Output for 5.4.11 - 5.6.28
Warning: Illegal string offset 'a' in /in/qOgME on line 8 Warning: Illegal string offset 'b' in /in/qOgME on line 8 Notice: Undefined variable: h in /in/qOgME on line 8 Warning: Illegal string offset 'a' in /in/qOgME on line 9 Warning: Illegal string offset 'b' in /in/qOgME on line 9 Warning: Illegal string offset 'a' in /in/qOgME on line 10 Warning: Illegal string offset 'b' in /in/qOgME on line 10 Warning: Illegal string offset 'a' in /in/qOgME on line 11 Warning: Illegal string offset 'b' in /in/qOgME on line 11 Fatal error: Call to undefined function valn() in /in/qOgME on line 13
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/qOgME on line 6
Process exited with code 255.