$sum = 0; foreach($arrObj as $key=>$value){ if(isset($value->commission)) $sum += $value->commission; } echo $sum;