<?php

$arr1 = array (
    array (
		'val_id' => 318,
		'value_name' => '40.0 RUS=41.0 EUR',
		'image' => null,
		'addprice' => 0,
	),
    array (
		'val_id' => 319,
		'value_name' => '41.0 RUS=42.0 EUR',
		'image' => null,
		'addprice' => 0,
	),
    array (
		'val_id' => 320,
		'value_name' => '42.0 RUS=43.0 EUR',
		'image' => null,
		'addprice' => 0,
	),
);

$arr2 = array (
    array (
		'attr_1' => 318,
		'count' => 2,
	),
	array (
		'attr_1' => 319,
		'count' => 1,
	),
    array (
		'attr_1' => 320,
		'count' => 4,
	),
);

for($i = 0, $cnt = count($arr1); $i < $cnt; ++$i)
{
	if(empty($arr2[$i]))
		continue;
	$arr1[$i] = array_merge($arr1[$i], $arr2[$i]);
}
$arr1 = array_map(function($v){ return (object) $v; }, $arr1);
var_dump($arr1);