- var_dump: documentation ( source)
- array_merge_recursive: documentation ( source)
<?php
$balances = [10000 => ['balance' => '50'], 42000 => ['balance' => '100']];
$profits = [10000 => ['profit' => '20'], 42000 => ['profit' => '15']];
// $report = [10000 => ['balance' => '50', 'profit' => '20'], 42000 => ['balance' => '100', 'profit' => '15']];
var_dump(array_merge_recursive($balances, $profits));