为什么可以通过静态调用访问公共函数 - PHP? [重复]

This question already has an answer here:

Please review below code. Though I have not define test method as static It can be access by A::test(). How it is possible? Is it bug in PHP?

class A {       
        public function test(){         
            echo __CLASS__;
        }
}
A::test(); //Print 'A'

If I try to access any public member inside test() method, It is giving me an error. See below.

class A {   
        public $name = 'jimit';
        public static function test(){          
                        echo $this->name;
            echo __CLASS__;
        }
    }
A::test(); //Error

Please help me out to clarify the things.

Thanks, Jimit

</div>

It is not a bug, but rather a leftover from PHP4's object model implementation. In current versions calling nonstatic method statically will raise an E_STRICT level warning.

As for the second one it is obvious, there's no instance of your class, so there is no $this to refer to.