php The double colon is a reference method for static methods and static properties in the class. The double colon is a static reference to the method in the class. That is, there is no need to instantiate the object, and the method in the class is directly referenced through the class name. Make a reference.
The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer
phpWhat does the double colon mean?
What do two consecutive colons in Php: : mean?
Reference methods for static methods and static properties in a class (two colons (::) refer to methods in the class Static reference; that is, there is no need to instantiate the object, and the method in the class is directly referenced through the class name)
For example:
class Test{ public static $test = 1; public static function test(){ } }
You can use Test::$ directly without instantiating the object. test to get the value of the $test attribute
The same goes for static method calls Test::test(); Directly call the static method test
Recommended learning: "PHP Video Tutorial》
The above is the detailed content of What does double colon mean in php. For more information, please follow other related articles on the PHP Chinese website!