PHP OOP - Static Properties
PHP - Static Properties
Without creating an instance of a class is Static propertie.
Static properties are declared with the static keyword:
Syntax
<?php
class ClassName {
public static $staticProp = "Codeplay";
}
?>
To access a static property use the class name, double colon (::), and the property name:
Syntax
ClassName::$staticProp;