PHP OOP – Static Methods

PHP – Static Methods

Static methods can be called directly – without creating an instance of the class first.

Static methods are declared with the static keyword:

Syntax

<?php
class ClassName {
  public static function staticMethod() {
    echo "Hello World!";
  }
}
?>

To access a static method use the class name, double colon (::), and the method name: Continue reading PHP OOP – Static Methods