后期静态绑定

Original 2019-03-26 14:54:47 168
abstract:<?phpclass A{public static $name = '陈学北';public static $age = 85;public static function showInfo(){echo static::$name, '<hr>';echo static::$age, '岁.<hr>';}}class

<?php


class A

{

public static $name = '陈学北';

public static $age = 85;


public static function showInfo()

{

echo static::$name, '<hr>';

echo static::$age, '岁.<hr>';

}

}

class F extends A

{

public static $name = '陈学东';

public static $age = 65;

}

class S extends F

{

public static $name = '陈学西';

public static $age = 45;

}

A::showInfo();

F::showInfo();

S::showInfo();



Correcting teacher:天蓬老师Correction time:2019-03-26 16:50:13
Teacher's summary:没看到你在哪里用到了重载, 是不是代码没有提交完整?

Release Notes

Popular Entries