Possible Duplicate:
What does PHP keyword 'var' do?
I know this can sound like a strange question, but it's something I can't get out of my head. I'm defining a class to handle invoice lines and their respective taxes and my current 'prototype' looks like this:
public function getRate() {
if (!empty($this->lines)) {
var $total = 0;
foreach ($this->lines as $line) {
$total += $line->subtotal;
}
return ['title' => $this->attributes['title'], 'value' => $this->attributes['value'], 'type' => $this->attributes['type'], 'total' => $total];
}
}
$total is just there to count the lines' total ammount (per tax rate, in this case), so in my thoughts, it has to be discarded once the function returns the array. The question is... which is more appropiate (as in more correct)? $total = 0;
or var $total = 0;
?