3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 44259 => [50007, 50009, 46372], 50007 => [50008], 50009 => [50010], 66666 => ['do', 'not', 'push'], 46372 => [46418, 46419, 46421], 46421 => [146880] ]; $mergedArray = []; foreach ($array as $subArray) { array_map(function($elm) { if (!in_array($elm, $mergedArray)) { $mergedArray[] = $elm; }, $subArray); } var_export($mergedArray);
Output for git.master
Parse error: syntax error, unexpected token "," in /in/RtUHE on line 17
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:
145.28 ms | 997 KiB | 7 Q