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”