Calling an Overridden Function : Override : Functions PHP Source Code


PHP Source Code » Functions » Override »

 

Calling an Overridden Function




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

     function message() {
         echo "the vehicle class!";
     }
  }

  class car extends vehicle {
     var $doors;
     var $rooftype;
     var $powersteering;
     var $powerwindows;

     function message() {
       echo "the car class."" n";
       vehicle::message();
     }
  }

  $merk= new car;
  $merk->message();
?>
           
       



HTML code for linking to this page:

    PHP Function Reference -> Users Code Examples / Notes - > Override:
  • override_function
Follow Navioo On Twitter

PHP Source Code

 Navioo Functions
» Override