3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_greedy_diff($x, $y) { $output = $x; for($i = $j = 0; $i < count($x) && j < count($y); ) { if ($x[i] == $y[j]) { unset($output[i]); $x++; } $j++; } return $output; } $a = array(1,2,3,1,2,3); $b = array(1,2,3); var_dump(array_greedy_diff($a, $b));
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Undefined constant "j" in /in/CSJjH:5 Stack trace: #0 /in/CSJjH(17): array_greedy_diff(Array, Array) #1 {main} thrown in /in/CSJjH on line 5
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:
39.89 ms | 401 KiB | 8 Q