136-PHP 使用类名访问static修饰的类方法

<?php
    class test{        //定义一个类
        public static function  class_info(){        //定义类方法
            return '这是一个用于测试的类。';
        }
    }
    echo test::class_info();        //使用类名访问static修饰的类方法
?> 

 

posted @ 2019-06-14 08:07  像一棵海草海草海草  阅读(128)  评论(0编辑  收藏  举报