Create two child classes : Class Inheritance : Class PHP Source Code


PHP Source Code » Class » Class Inheritance »

 

Create two child classes



<?php
  class vehicle{
      var $brand_name;
      var $number_of_wheels;
      var $seating_capacity;
  }

  class car extends vehicle {
      var $doors;
      var $prooftype;
      var $powersteering;
      var $powerwindows;
  }

  class motorbike extends vehicle {
      var $engine;
  }

  $merk= new car;
  $dukat=new motorbike;

?>


           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Class
» Class Inheritance