protected member variable : protected : Class PHP Source Code


PHP Source Code » Class » protected »

 

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();

?>

           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Class
» protected