后期绑定语句

Original 2019-03-04 20:26:43 239
abstract:<?php  class Father{  public static $money=80000;  public static function getClass(){  return __class__;  }  public static function getMone(){  return self

<?php 

 class Father{

  public static $money=80000;

  public static function getClass(){

  return __class__;

  }

  public static function getMone(){

  return self::getClass()."的工资是:".self::$money."元";

  }

 }

  

  class sun extends Father{

    public static $money=4000;

    public static function getClass(){

    return __class__;

    }

  }


echo Father::getClass()."<br>";

echo Father::getMone()."<br>";

echo sun::$money;

echo sun::getClass();

echo "<hr>";

echo sun::getMone()."<br>";//犯了一个小错识误,23行差了一个分号,就24行报错;


 ?>


Correcting teacher:韦小宝Correction time:2019-03-05 09:22:13
Teacher's summary:PHP中的报错就是这样 在找PHP找报错的时候要记得注意报错行的上下有没有错误 作业写的还是很不错的 要记得在实际的开发中去使用才能更好的掌握

Release Notes

Popular Entries