自己以为解释static 解释比较好的列子,希望大家,也能通过它来理解 <?php // USING the same method in an instance and in a static context // If you want to have the same definition of a method that you // want to use both as static and as instance method, a classname control of $this // variable is needed. This tip can be used wether the caller context is not the same class type class A { private $myProp = 'A'; public function myMethodA() { if(isset($this) && get_class($this) == __CLASS__) return $this->myProp; return 'C'; } } class B { public $myProp = 'B'; public function myMethodB() { $a = new A; return $a->myMethodA().' ++++ '.A::myMethodA(); } } $b = new B(); echo $b->myMethodB(); // output: A ++++ C // NOTE: // if you don't verify "&& get_class($this) == __CLASS__" // it will output A ++++ B, it seems that if a method is not marked as "static" // its scope would be the scope in which the function was called ?>