In OOP-& gt; and: operator differences in OOP-> And: What are the differences between operators? Du Niang is not powerful and cannot be found
Reply to discussion (solution)
Variable modified by the static keyword. the external call can only be ::
Static Keyword modifier method, external call-> and: are acceptable, used:, static method cannot operate non-static variables
Now, I want to add it downstairs.
-> Instance call
: It is the reference method of static methods and static properties in the class.
-> Indicates the object member.
: Scope resolution operator. The manual says: functions in the category class or functions and variables in the base class are very useful without declaring any instances. The operator is used in this case.
Although php 5.3 and later have made some restrictions on the usage of:, there is not much difference in general.
1. if a function is defined as static, the direct class name is: method name, and the static attribute is the same.
2. if you only define the function method name (), you need to instantiate the class during access, $ p = new xx (); $ p-> method name ();