I have a class with a protected variable in it which can be get by a function getVariable().
How much difference will it make if i’ll call getVariable() every time instead of storing the result once and then use it? (the getVariable() does nothing more than return $this->var)
It should not matter either way for you, premature optimization is bad. Do what makes sense design wise, not optimization wise. Either way, function/method calls in php are pretty cheap.