php中 -> 和 :: 的使用

                       类内                                       类外
常量               self::DB_HOST                              Student::DB_HOST 
静态属性            self::attr                                 Student::attr;    
静态方法            $this -> method()   self::method()         Student::method()   $obj -> method()
成员属性            $this -> attr                              $obj -> attr
成员方法            $this -> method()   self::method()         Student::method()  $obj -> method()

调用属性 ::用$   ->不用$
原文地址:https://www.cnblogs.com/mengor/p/12408388.html