3v4l.org

run code in 300+ PHP versions simultaneously
<?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));

preferences:
37.35 ms | 402 KiB | 5 Q