<?php
class Worker {
public $name;
public $level;
public $chief;
public $coffe;
public $paid;
public $pages;
public function drinkCoffe() {
if ($this->chief) {
return ($coffe *2);
} else {
return $coffe;
}
}
}
class Manager extends Worker {
public function __construct($name, $level, $chief) {
$this->name = $name;
$this->level = $level;
$this->chief = $chief;
$this->coffe = 20;
$this->paid = 500;
$this->pages = 200;
}
}
$stv = new Manager('Peter', 1, True);
echo $stv->drinkCoffe();
?>
PD9waHAKCmVycm9yX3JlcG9ydGluZygtMSk7Cm1iX2ludGVybmFsX2VuY29kaW5nKCd1dGYtOCcpOwoKY2xhc3MgV29ya2VyIHsKCXB1YmxpYyAkbmFtZTsKCXB1YmxpYyAkbGV2ZWw7CglwdWJsaWMgJGNoaWVmOwoJcHVibGljICRjb2ZmZTsKCXB1YmxpYyAkcGFpZDsKCXB1YmxpYyAkcGFnZXM7CgkKCXB1YmxpYyBmdW5jdGlvbiBkcmlua0NvZmZlKCkgewoJCWlmICgkdGhpcy0+Y2hpZWYpIHsKCQkJcmV0dXJuICgkY29mZmUgKjIpOwoJCX0gZWxzZSB7CgkJCXJldHVybiAkY29mZmU7CgkJfQoJfQp9CmNsYXNzIE1hbmFnZXIgZXh0ZW5kcyBXb3JrZXIgewoJcHVibGljIGZ1bmN0aW9uIF9fY29uc3RydWN0KCRuYW1lLCAkbGV2ZWwsICRjaGllZikgewoJCSR0aGlzLT5uYW1lID0gJG5hbWU7CgkJJHRoaXMtPmxldmVsID0gJGxldmVsOwoJCSR0aGlzLT5jaGllZiA9ICRjaGllZjsKCQkkdGhpcy0+Y29mZmUgPSAyMDsKCQkkdGhpcy0+cGFpZCA9IDUwMDsKCQkkdGhpcy0+cGFnZXMgPSAyMDA7Cgl9Cn0KJHN0diA9IG5ldyBNYW5hZ2VyKCdQZXRlcicsIDEsIFRydWUpOwplY2hvICRzdHYtPmRyaW5rQ29mZmUoKTsKPz4=