I have this class:
class testclass{
function func1(){
return "hello";
}
function func2(){
echo func1();
}
}
When I am running
$test = new testclass();
$test->func2();
I get an error: Fatal error: Call to undefined function func1()
with the line index of echo func1();
My question now is, how do I make the func2
recognize func1
Is this a problem with the scopes?
function func2(){
echo func1();
}
should be
function func2(){
echo $this->func1();
}