3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array('a' => $a, 'b' => $b, 'c' =>$c); foreach($array as $letter => $subArray){ foreach($subArray as $key => $values){ $newArray[$letter.$key] = $values['value']; } } $uniques = array_unique($newArray); //getting the non-repeated values $repeated = array_diff_assoc($newArray, $uniques); // stripping them out $final = array_unique($repeated); //cleaning the repeated values to just 1 of each print_r($final);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $a in /in/crVJ7 on line 2 Warning: Undefined variable $b in /in/crVJ7 on line 2 Warning: Undefined variable $c in /in/crVJ7 on line 2 Warning: foreach() argument must be of type array|object, null given in /in/crVJ7 on line 4 Warning: foreach() argument must be of type array|object, null given in /in/crVJ7 on line 4 Warning: foreach() argument must be of type array|object, null given in /in/crVJ7 on line 4 Warning: Undefined variable $newArray in /in/crVJ7 on line 9 Fatal error: Uncaught TypeError: array_unique(): Argument #1 ($array) must be of type array, null given in /in/crVJ7:9 Stack trace: #0 /in/crVJ7(9): array_unique(NULL) #1 {main} thrown in /in/crVJ7 on line 9
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:
41.44 ms | 402 KiB | 8 Q