3v4l.org

run code in 300+ PHP versions simultaneously
<?php $toppings1 = array("Pepperoni", "Cheese", "Anchovies", "Tomatoes"); $toppings2 = array("Ham", "Cheese", "Peppers"); $inttoppings = array_intersect($toppings1, $toppings2); $difftoppings = array_diff($toppings1, $toppings2); $bothtoppings = array_merge($toppings1, $toppings2); $bothtoppings = array_unique($bothtoppings); var_dump($inttoppings); var_dump($difftoppings); var_dump($bothtoppings); ?>
Output for git.master, git.master_jit, rfc.property-hooks
array(1) { [1]=> string(6) "Cheese" } array(3) { [0]=> string(9) "Pepperoni" [2]=> string(9) "Anchovies" [3]=> string(8) "Tomatoes" } array(6) { [0]=> string(9) "Pepperoni" [1]=> string(6) "Cheese" [2]=> string(9) "Anchovies" [3]=> string(8) "Tomatoes" [4]=> string(3) "Ham" [6]=> string(7) "Peppers" }

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:
49.33 ms | 402 KiB | 8 Q