3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [ ["Paris SG", "Brest", "Monaco", "Nizza", "Lilla", "Lens", "Sturm Graz"], ["Marsiglia", "Rennes", "Reims", "Lione", "Tolosa", "Strasburgo"], ["Le Havre", "Montpellier", "Lorient", "Nantes", "Metz", "Clermont"], ]; $array2 = [ "Sturm Graz", "Rennes", "Sturm Graz", "Reims", "Tolosa", "Le Havre", "Paris SG", "Lione", "Clermont", "Montpellier", "Lorient", "Strasburgo" ]; $result = []; foreach ($array1 as $row) { foreach ($row as $val) { $i = array_search($val, $array2); if ($i !== false) { unset($array2[$i]); $result[] = $val; } } } var_export($array2); echo "\n---\n"; var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 2 => 'Sturm Graz', ) --- array ( 0 => 'Paris SG', 1 => 'Sturm Graz', 2 => 'Rennes', 3 => 'Reims', 4 => 'Lione', 5 => 'Tolosa', 6 => 'Strasburgo', 7 => 'Le Havre', 8 => 'Montpellier', 9 => 'Lorient', 10 => 'Clermont', )

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