Class inheritance in action : Class Inheritance « Class « PHP






Class inheritance in action


<?php

class AbstractClass {
    function abstractFunction() {
        die( "AbstractClass::abstractFunction() is abstract\n" );
    }
}

class ConcreteClass extends AbstractClass {}

$test = new ConcreteClass();
$test->abstractFunction();

           
       








Related examples in the same category

1.Inheriting a Shape Class
2.Improved Inheritance: call parent constructor
3.Create two child classes
4.Creating a Class That Inherits from Another