Skip to content

Cardiologist Class

Cardiologist.php - OOP in PHP (Demonstration): Complete Code Listing

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
<?php
    require_once('Surgeon.php');

    class Cardiologist extends Surgeon
    {
        // METHODS
        //////////
        // drawBlood - derived from Doctor class
        public function drawBlood()
        {
            echo "Cardiologist $this->name is drawing blood directly from the heart!<br/>";
        }

        public function harvestHearts()
        {
            echo "Cardiologist $this->name is harvesting hearts<br/>";
        }
    }