Protected Member Variable

 
    <?php   class Staff
   {
      protected $name;
      protected $title;      function __construct()
      {
         echo "<p>Staff constructor called!</p>";
      }
   }   class Manager extends Staff
   {
      function __construct()
      {
         parent::__construct();
         echo "<p>Manager constructor called!</p>";
      }
   }   $employee = new Manager();?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.