·  PHP – Syntax – OOP – Classes – Components – Methods – Custom – Scope – Static

 

- Info:

  - Method is declared as static by using keyword static.

  - Static methods can be called by both using class name and through an object.

 

- Example:

  - Creat PHP Console Application Test.php.

 

    Test.php

    <?php

   

      class Person {  

        static function say() { echo "Hello\n"; }  

      }

      

      Person::say();

      $john = new Person();

      $john->say();

      

    ?>