php类与对象 static静态方法和静态属性

<?php
//类常量的定义与访问
class Stu
{
    private static $count = 45;  
    public static function grade()
    {
        $str = __FILE__.'<br>';
        $str .= __FUNCTION__.'<br>';
        $str .= Stu::$count;
        echo $str;
    }
}
Stu::grade();

原文地址:https://www.cnblogs.com/xm666/p/11254085.html