extends in action : extends « Class « PHP






extends in action

<?php
class Checkout {
    final function totalize() {
        // calculate bill
    }
}

class IllegalCheckout extends Checkout {
    final function totalize() {
        // change bill calculation
    }
}

$checkout = new Checkout();

?>


           
       








Related examples in the same category