Im trying to teach myself enough to start using more OOP in php.  This is what Ive come up with. Is there any reason why any of this is done wrong, or should be done another way?    class workers {            private $name;            function __construct($name){                $this->name=$name;            }            function setName($name){                $this->name=$name;              }            function doPrint($who){                print $who->name . ' is ' . $who->isWhat() .'<br>';            }    }    class boss extends workers{            function isWhat(){                return 'the boss';            }    }    class bee extends workers{            function isWhat(){                return 'not the boss';            }    }    $theboss =new boss('gordon');       $thebee= new bee('johnny');        workers::doPrint($theboss);        workers::doPrint($thebee);    $theboss->setName('johnny');    $thebee->setName('gordon');        workers::doPrint($theboss);        workers::doPrint($thebee);prints:gordon is the bossjohnny is not the bossjohnny is the bossgordon is not the boss
advice on polymorphism
php;object oriented
you should use an abstract class and an interface. also define the doPrint method as static when you want to call it static.abstract class worker {    /*...*/    public static function doPrint(worker_interface $who) {        /*...*/    }}interface worker_interface {    public function isWhat();    public function setName($name);}class boss extends worker implements worker_interface {    public function isWhat() {        return 'the boss';    }}class bee extends worker implements worker_interface {    public function isWhat() {        return 'not the boss';    }}define the type for all methods you are passing worker instances to like in doPrintEDIT:alternatively you could also just add an abstract function instead of using an interfaceabstract class worker {    /*...*/    public static function doPrint(worker $who) {        /*...*/    }    public abstract function isWhat();}class boss extends worker {    public function isWhat() {        return 'the boss';    }}class bee extends worker {    public function isWhat() {        return 'not the boss';    }}