<?php //定义一个父类 class Father { //静态属性 public static $money = 50000; //静态方法: 访问当前类中的其它静态成员 public static function getMoney() { // return self::getClass() . '::' . self::$money; //后期静态绑定,使用static,在静态继承的上下文中,动态的与调用类绑定 return static::$money; } } Son::$money= 35000; //定义子类,继承自 Father class Son extends Father { //覆写父类静态属性 public static $money = 30000; } echo