后期静态技术绑定,动态匹配成员的调用者
<?php class Big { public static $product = '海尔'; public static function getClass() { return __CLASS__; } public static function getPro() { // return '一级分类:' .self::getClass() .'<br>品牌:' .self::$product; return '一级分类:' .static::getClass() .'<br>品牌:' .static::$product; } } class Small extends Big { public static $product = '格力'; public static function getClass() { return __CLASS__; } } echo Big::$product .'<hr>'; echo Big::getClass() .'<hr>'; echo Big::getPro() .'<hr>'; echo Small::$product .'<hr>'; echo Small::getClass() .'<hr>'; echo Small::getPro() .'<br>';