`class market{
public $count;
public $fruits;
public function __construct(){
$this->fruits=array();
$this->count=0;
}
public function shop(){
$total=0;
$this->fruits=$fruits;
foreach($this->fruits as $item){
$total+=$item->count;
}
return $total;
}
}
`This is a piece of code from an existing project,how does $total+=$item->count works here.
$total+=$item will work
what is $total+=$item->count here?