<?php
class Foo{
protected $calc;
function __construct(){
$this->calc = 2;
}
public static function getCalc(){
return $this->calc * 5;
}
}
Foo::getCalc();
When I squeeze, it gives me this error:
Fatal error: Using $ this when not in object context in ...
Why can not I call a protected
variable within a function defined as static?