I don’t understand the concept of getter and setter methods in PHP, pls help me out.
Let’s say I have this class:
class something()
{
public function test()
{
$bla = 10;
return $var;
}
}
How do I get the follwing code to work:
$something->test();
echo $bla;
Thanks!
First this:
should be:
and second, the second part is wrong and should be like this: