3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = ['keepThis', 'remove', 'keep', 'save', 'delete']; $array2 = ['hangOnto', 'remove', 'retain', 'keep', 'delete']; $clean1 = $array1; $clean2 = array_diff_ukey( $array2, $array1, function($a, $b) use (&$clean1, $array1, $array2) { if (isset($array2[$b]) && $array2[$b] === $array1[$b]) { unset($clean1[$b]); } return strcmp($array2[$a], $array1[$b]); } ); print_r($clean1); print_r($clean2);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => keepThis [2] => keep [3] => save ) Array ( [0] => hangOnto [2] => retain )

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:
52.18 ms | 401 KiB | 8 Q