3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = ['sr_no' => 72, 'batch_id' => 1]; $array2 = [ ['quantity' => 22, 'sr_no' => 71, 'batch_id' => 2, 'inq_id' => 91], ['quantity' => 35, 'sr_no' => 72, 'batch_id' => 1, 'inq_id' => 92], ['quantity' => 20, 'sr_no' => 69, 'batch_id' => 3, 'inq_id' => 90], ]; $result = null; foreach ($array2 as $row) { if (array_intersect_assoc($array1, $row) === $array1) { $result = $row; break; } } var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 'quantity' => 35, 'sr_no' => 72, 'batch_id' => 1, 'inq_id' => 92, )

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:
166 ms | 405 KiB | 5 Q