Class Inheritance

<?php
     class ParentClass {
          public $parentvar;
          public function parentOne() {
               echo "Called parentOne()\n";
          }
          private function parentTwo() {
               echo "Called parentTwo()!\n";
          }
     }     class ChildClass extends ParentClass {
          public function childOne() {
               echo "Called childOne()!\n";
          }
     }     $v = new ChildClass();
     $v->parentOne();
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.