3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ar1 = array( (object) array('id' => '1505', 'category' => 'blue'), (object) array('id' => '1805', 'category' => 'red') ); $ar2 = array( '1777' => (object) array('id' => '1505', 'category' => 'yellow'), '1877' => (object) array('id' => '1507', 'category' => 'blue'), ); $ids = array_column($ar1, 'id'); $ar3 = array_merge_recursive($ar1, array_filter($ar2, function($x) use ($ids) { return !in_array($x->id, $ids); })); print_r($ar3);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => stdClass Object ( [id] => 1505 [category] => blue ) [1] => stdClass Object ( [id] => 1805 [category] => red ) [2] => stdClass Object ( [id] => 1507 [category] => blue ) )

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:
114.3 ms | 406 KiB | 5 Q