3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['App', 'Classes', 'Auth'], ['App', 'Classes', 'Auth'], ['App', 'Classes', 'Middleware'], ['App', 'Classes', 'Phone'], ['App', 'Classes', 'Auth'], ['App', 'Mail'], ['App', 'Mail', 'Sender'], ['App', 'Box'], ]; $results = json_decode(json_encode($array)); $tree = null; foreach ($results as $result) { $thisref = &$refs->{$result[0]}; $tree->{$result[0]} = &$thisref; $thisref = &$refs->{$result[1]}; $tree->{$result[0]}->{$result[1]} = &$thisref; if (!empty($result[2])) { $thisref = &$refs->{$result[2]}; $refs->{$result[0]}->{$result[1]}[] = $result[2];//&$thisref; $refs->{$result[0]}->{$result[1]} = array_unique($refs->{$result[0]}->{$result[1]}); } } print_r(json_decode(json_encode($tree), true));
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Attempt to modify property "App" on null in /in/2udcX:15 Stack trace: #0 {main} thrown in /in/2udcX on line 15
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
57.4 ms | 401 KiB | 8 Q