1 <?php 2 class Dog{ 3 public static $name=‘小花‘; 4 const age=12; 5 } 6 Dog::$name=‘小草‘; 7 echo Dog::$name; 8 echo Dog::age; 9 ?>
结果是
输出”小草12”
面向对象_3-15选择题
原文:https://www.cnblogs.com/kay-learning/p/8964866.html