3v4l.org

run code in 300+ PHP versions simultaneously
<?php $compare = function($a, $b) use(&$iteration_count) { echo("$a : $b\n"); $iteration_count++; return strcmp($a, $b); }; $a = array('a', 'b', 'c', 'n'); $b = array('m', 'x', 'y', 'z'); $iteration_count = 0; echo "array_udiff:" . json_encode(array_udiff($a, $b, $compare)) . "\n"; echo "iterations: $iteration_count\n\n"; $iteration_count = 0; echo "array_uintersect:" . json_encode(array_uintersect($a, $b, $compare)) . "\n"; echo "iterations: $iteration_count\n\n";
Output for git.master, git.master_jit, rfc.property-hooks
a : b b : c c : n m : x x : y y : z a : m a : b b : m b : c c : m c : n n : m n : x array_udiff:["a","b","c","n"] iterations: 14 a : b b : c c : n m : x x : y y : z a : m b : m c : m n : m n : m n : x array_uintersect:[] iterations: 12

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