Instantiate Class By Calling The Constructor

 
    <?php
   class Staff
   {
      private $ein;
      function __construct($ein)
      {
         if ($this->verify_ein($ein)) {
            echo "called";
         }
      }
 
      protected function verify_ein($ein)
      {
         return TRUE;
      }
   }   $employee = new Staff("123");?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.