3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_diff_objects (array $array1, array ... $arrays): array { $arrays[] = function (object $a, object $b) { if ($a === $b) { return 0; } return spl_object_id($a) > spl_object_id($b) ? -1 : 1; }; return array_udiff($array1, ... $arrays); } class C {} $a = new C; $a->foo = 'aa'; $b = new C; $b->foo = 'bb'; $c = new C; $c->foo = 'cc'; var_dump(array_diff_objects([$b, $a, $c], [$c, $b]));
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Creation of dynamic property C::$foo is deprecated in /in/lWH0C on line 20 Deprecated: Creation of dynamic property C::$foo is deprecated in /in/lWH0C on line 21 Deprecated: Creation of dynamic property C::$foo is deprecated in /in/lWH0C on line 22 array(1) { [1]=> object(C)#1 (1) { ["foo"]=> string(2) "aa" } }

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