Call Class Methods Directly

 
    <?php
   class Visitors
   {
      public function greetVisitor()
      {
         echo "Hello<br />";
      }      function sayGoodbye()
      {
         echo "Goodbye<br />";
      }
   }   Visitors::greetVisitor();
   $visitor = new Visitors();
   $visitor->sayGoodbye();
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.