What does :: mean in php? About the description and application of :: in php

WBOY
Release: 2016-07-29 09:15:13
Original
1316 people have browsed it
1. Reference methods of static methods and static properties in classes
For example,
class Test{
public static $test = 1;
public static function test(){
}
}
can be used without instances Transform the object and directly use Test::$test to get the value of the $test attribute

The same applies to calling the static method Test::test(); directly call the static method test

2.Two colons (::) are static references to methods in the class
That is, there is no need to instantiate the object, and the methods in the class are directly referenced through the class name

The above introduces what does :: mean in php? Regarding the description and application of :: in php, it includes some aspects. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template