class Wheather {
public $nonStatic = 0;
public static $tempConditions = ['cold', 'mild', 'warm'];
public static $someProperty = 5;
static function celsiusToFarenheit($celsius) {
return $celsius * 9 / 5 + 32 + $this->nonStatic;
}
}
echo Wheather::celsiusToFarenheit(0);
echo "\n";
In this case we will get the error:
Fatal error: Uncaught Error: Using $this when not in object context