3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [ [ "transaction_id" => 62369600431, "invoice_number" => 37161 ], [ "transaction_id" => 62369595048, "invoice_number" => 37346 ], [ "transaction_id" => 62369600431, "invoice_number" => 38064 ] ]; $array2 = [ [ "invoice_number" => 37161 ], [ "invoice_number" => 37346 ] ]; $invoiceNumbers = array_column($array2, "invoice_number"); $result = array_filter($array1, function($x) use ($invoiceNumbers) { return in_array($x["invoice_number"], $invoiceNumbers); }); print_r($result);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [transaction_id] => 62369600431 [invoice_number] => 37161 ) [1] => Array ( [transaction_id] => 62369595048 [invoice_number] => 37346 ) )

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