Mega Code Archive

 
Categories / Php / Class
 

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"); ?>