How to add two different variables within two different functions and store values into another variable inside another function. This my code: but i got output as 0 instead of 30
<?php
class race
{
var $a;
var $b;
function fast()
{
$a=10;
$this->a;
}
function slow()
{
$b=20;
$this->b;
}
function avg()
{
$c=$this->a+$this->b;
echo $c;
}
}
$relay = new race();
$relay->avg();
?>