3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $x['a']['b']['c']['d']['e']='y'; $x['aaa']='FirstLevel'; $x['a']['_parent'] = &$x; $x['a']['b']['_parent'] = &$x['a']; $x['a']['b']['c']['_parent'] = &$x['a']['b']; $x['a']['b']['c']['d']['_parent'] = &$x['a']['b']['c']; print_r($x);
based on 0U1k9
Output for 7.0.0 - 7.1.0
Array ( [a] => Array ( [b] => Array ( [c] => Array ( [d] => Array ( [e] => y [_parent] => Array *RECURSION* ) [_parent] => Array *RECURSION* ) [_parent] => Array *RECURSION* ) [_parent] => Array *RECURSION* ) [aaa] => FirstLevel )
Output for hhvm-3.12.0
Array ( [a] => Array ( [b] => Array ( [c] => Array ( [d] => Array ( [e] => y [_parent] => Array ( [d] => Array ( [e] => y [_parent] => Array *RECURSION* ) [_parent] => Array ( [c] => Array *RECURSION* [_parent] => Array ( [b] => Array *RECURSION* [_parent] => Array ( [a] => Array *RECURSION* [aaa] => FirstLevel ) ) ) ) ) [_parent] => Array ( [c] => Array ( [d] => Array ( [e] => y [_parent] => Array *RECURSION* ) [_parent] => Array *RECURSION* ) [_parent] => Array ( [b] => Array *RECURSION* [_parent] => Array ( [a] => Array *RECURSION* [aaa] => FirstLevel ) ) ) ) [_parent] => Array ( [b] => Array ( [c] => Array ( [d] => Array ( [e] => y [_parent] => Array ( [d] => Array ( [e] => y [_parent] => Array *RECURSION* ) [_parent] => Array *RECURSION* ) ) [_parent] => Array *RECURSION* ) [_parent] => Array *RECURSION* ) [_parent] => Array ( [a] => Array *RECURSION* [aaa] => FirstLevel ) ) ) [_parent] => Array ( [a] => Array ( [b] => Array ( [c] => Array ( [d] => Array ( [e] => y [_parent] => Array ( [d] => Array ( [e] => y [_parent] => Array *RECURSION* ) [_parent] => Array ( [c] => Array *RECURSION* [_parent] => Array *RECURSION* ) ) ) [_parent] => Array ( [c] => Array ( [d] => Array ( [e] => y [_parent] => Array *RECURSION* ) [_parent] => Array *RECURSION* ) [_parent] => Array *RECURSION* ) ) [_parent] => Array *RECURSION* ) [_parent] => Array *RECURSION* ) [aaa] => FirstLevel ) ) [aaa] => FirstLevel )
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.3.0 - 5.6.28
Array ( [a] => Array ( [b] => Array ( [c] => Array ( [d] => Array ( [e] => y [_parent] => Array *RECURSION* ) [_parent] => Array *RECURSION* ) [_parent] => Array *RECURSION* ) [_parent] => Array ( [a] => Array *RECURSION* [aaa] => FirstLevel ) ) [aaa] => FirstLevel )
Output for 5.1.0 - 5.2.17
Array ( [a] => Array ( [b] => Array ( [c] => Array ( [d] => Array ( [e] => y [_parent] => Array *RECURSION* ) [_parent] => Array ( [c] => Array ( [d] => Array ( [e] => y ) [_parent] => Array *RECURSION* ) [_parent] => Array ( [b] => Array *RECURSION* [_parent] => Array ( [a] => Array *RECURSION* [aaa] => FirstLevel ) ) ) ) [_parent] => Array ( [b] => Array ( [c] => Array ( [d] => Array ( [e] => y ) [_parent] => Array *RECURSION* ) [_parent] => Array *RECURSION* ) [_parent] => Array ( [a] => Array *RECURSION* [aaa] => FirstLevel ) ) ) [_parent] => Array ( [a] => Array *RECURSION* [aaa] => FirstLevel ) ) [aaa] => FirstLevel )
Output for 4.3.0 - 5.0.5
Array ( [a] => Array ( [b] => Array ( [c] => Array ( [d] => Array ( [e] => y [_parent] => Array *RECURSION* ) [_parent] => Array *RECURSION* ) [_parent] => Array ( [b] => Array ( [c] => Array ( [d] => Array ( [e] => y ) ) [_parent] => Array *RECURSION* ) [_parent] => Array ( [a] => Array *RECURSION* [aaa] => FirstLevel ) ) ) [_parent] => Array ( [a] => Array ( [b] => Array ( [c] => Array ( [d] => Array ( [e] => y ) ) [_parent] => Array *RECURSION* ) [_parent] => Array *RECURSION* ) [aaa] => FirstLevel ) ) [aaa] => FirstLevel )