What is :: operator and in what case we use it in php?

Last updated 2 years ago | 327 views 75     5

Tags:- PHP

PHP | :: operator | scope resolution operator

This operator is known as the scope resolution operator. And this operator is used to access the static members of the class. To access static members of a class we do not need to create an object/instance of the class.

 
<?php

Class welcome {

Static public function xyz(){

Echo “Hello StudyZone4U.com”;

}

}

welcome::xyz(); 

?>

// Output will be "Hello StudyZone4U.com".