http://codepad.viper-7.com/I0Zqoi
I don’t understand what happened to this or how to fix it or why. Can someone who knows a little about programming explain what happens behind the scenes, for example, at the translator level? Also, how can I fix my problem and why should I write the code in order to fix it? Can you tell me, in human language, what's wrong with this and how to make it better? I think my book does not explain very well, and the code inside it does not work.: / Thank you.
class A
{
private $foo = 'bar';
function read()
{
echo self::$foo;
}
}
$a = new A();
a::read();
Strict Standards: Non-static method A::read() should not be called statically in /code/I0Zqoi on line 13
Fatal error: Access to undeclared static property: A::$foo in /code/I0Zqoi on line 8
"" . -, (, A { read() {echo "whatever" };} :: read(), → ). , , (, A {static $variable; function read() {echo $this- > variable};} a- > read(); 't , → , .). , , . , , , . , , , . , ? , , , , , , .: (((