3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fromBackend = [ 114466 => [ "BrandID" => 136, "record" => 114466 ], 114467 => [ "BrandID" => 1, "record" => 114467 ], 114468 => [ "BrandID" => 2, "record" => 114468 ] ]; $fromFrontEnd = array((object)['id' => 117, 'brandId' => 1], (object)['id' => 118, 'brandId' => 2]); $recordsToDelete = array(); foreach ($fromBackend as $backendItem) { foreach ($fromFrontEnd as $frontendItem) { if ($frontendItem->brandId == $backendItem['BrandID']) break; } if ($frontendItem->brandId != $backendItem['BrandID']) $recordsToDelete[] = $backendItem['record']; } print_r($recordsToDelete);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => 114466 )

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