php基础知识:类与对象(5) static
Declaring class members or methods as static makes them accessible without needing an instantiation of the class. A member declared as static can not be accessed with an instantiated class object (though a static method can). 声明静态的类变量和方法可以不需要实例化类对象的情况下对他们进行调用。静态类不能被类对象调用。(类的静态方法可以)。//注意看第一个例子,在一个非静
用户评论