https://note.com/dotinstall/n/nc0feca3bda82
return $total;
とは$total = 0;を書き換えるイメージで合っているでしょうか。
$total = 0;
この回答を見るにはプレミアムプランへの登録が必要です