3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 44259 => [50007, 50009, 46372], 33333 => [11111], 50007 => [50008], 22222 => [33333], 50009 => [50010], 66666 => ['no', 'other', 'links'], 46372 => [46418, 46419, 46421], 46421 => [146880] ]; do { $changes = false; foreach ($array as $k => &$row) { foreach ($row as $v) { if (isset($array[$v])) { array_push($array[$k], ...$array[$v]); unset($array[$v]); $changes = true; } } } } while($changes); var_export($array);
Output for git.master_jit, git.master, rfc.property-hooks
array ( 44259 => array ( 0 => 50007, 1 => 50009, 2 => 46372, 3 => 50008, 4 => 50010, 5 => 46418, 6 => 46419, 7 => 46421, 8 => 146880, ), 22222 => array ( 0 => 33333, 1 => 11111, ), 66666 => array ( 0 => 'no', 1 => 'other', 2 => 'links', ), )

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:
137.7 ms | 406 KiB | 5 Q