3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ 0 => [ "sales_total" => "4165.80", "staff_id" => 6, ], 1 => [ "sales_total" => "1335.60", "staff_id" => 10, ], ]; $arr1 = [ 0 => [ "id" => 6, "sales_target_amount" => "30000.00", ], 1 => [ "id" => 10, "sales_target_amount" => "1000.00", ], ]; $arr = array_column($arr, null, 'staff_id'); $temp = array_column($arr1, 'sales_target_amount', 'id'); foreach ($arr as $key => $value) { $arr[$key]['sales_target_amount'] = $temp[$key]; } print_r(array_values($arr));
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [sales_total] => 4165.80 [staff_id] => 6 [sales_target_amount] => 30000.00 ) [1] => Array ( [sales_total] => 1335.60 [staff_id] => 10 [sales_target_amount] => 1000.00 ) )

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