- Code: Select all
//I have declared the variables above this, including the one holding the array
public function pitcherRatingCalc()
{
$this->pitches = array($this->fastball,$this->curve,$this->slider);
$this->pitcherRating = array_sum($this->pitches);
}
This is a very simple function and I'd think by calling
- Code: Select all
$pitcher = new pitcher;
$pitcher->curve = 100;
$pitcher->fastball = 100;
$pitcher->pitcherRatingCalc;
echo $pitcher->pitcherRating;
that I would get the sum of the ratings, but instead I get nothing. Can someone tell me what I'm doing wrong please?

