Skip to content

Surgeon Class

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
<?php
    require_once('Doctor.php');

    class Surgeon extends Doctor
    {        
        // METHODS
        //////////
        public function cutPeopleOpen()
        {
            echo "Surgeon $this->name is cutting people open.<br/>";
        }
    }