<?php class Shirt { public function test() { return "Shirt"; } } class Sweater extends Shirt { public function test() { return "Sweater"; } } $shirt = new Sweater(); output_shirt($shirt); function output_shirt(Shirt $shirt) { echo $shirt->test(); }
You have javascript disabled. You will not be able to edit any code.