PHP: self:: vs parent:: with extends
问题 I'm wondering what is the difference between using self:: and parent:: when a static child class is extending static parent class e.g. class Parent { public static function foo() { echo 'foo'; } } class Child extends Parent { public static function func() { self::foo(); } public static function func2() { parent::foo(); } } Is there any difference between func() and func2() and if so then what is it ? Thank you Regards 回答1: Child has foo() Parent has foo() self::foo() YES YES Child foo() is