3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); abstract class AbstractWorker { private $rank; private $isBoss; private $salary; private $coffee; abstract public function getBasicPages(): int; public function __construct(int $rank, bool $isBoss, int $salary, int $coffee) { $this->rank = $rank; $this->isBoss = $isBoss; $this->coffee = $coffee; $this->salary = $salary; } public function getRank(): int { return $this->rank; } public function setRank(int $rank): void { $this->rank = $rank; } public function getBoss(): bool { return $this->isBoss; } public function setBoss(bool $isBoss): void { $this->isBoss = $isBoss; } public function getSalary(): float { $modifiedSalary = $this->salary; if ($this->rank == 2){ $modifiedSalary *= 1.25; } elseif ($this->rank == 3){ $modifiedSalary *= 1.5; } if ($this->isBoss){ $modifiedSalary *= 1.5; } return $modifiedSalary; } public function getCoffee(): int { $modifiedCoffee = $this->coffee; if ($this->isBoss){ $modifiedCoffee *= 2; } return $modifiedCoffee; } public function getPages(): int { $pages = $this->getBasicPages(); if ($this->isBoss){ $pages = 0; } return $pages; } public function setSalary(float $salary): void { $this->salary = $salary; } public function setCoffee(int $coffee): void { $this->coffee = $coffee; } } class Manager extends AbstractWorker { public function getBasicPages(): int { return 200; } } class Marketer extends AbstractWorker { public function getBasicPages(): int { return 150; } } class Engineer extends AbstractWorker { public function getBasicPages(): int { return 50; } } class Analyst extends AbstractWorker { public function getBasicPages(): int { return 5; } } class Department { private $name; private $workers = array(); public function __construct(string $name) { $this->name = $name; } public function getName(): string { return $this->name; } public function addWorker(AbstractWorker $worker): void { $this->workers[] = $worker; } public function getNumberWorkers(): int { return count($this->workers); } public function getDepartmentSalary(): float { $totalSalary = 0; foreach ($this->workers as $worker) { $totalSalary += $worker->getSalary(); } return $totalSalary; } public function getDepartmentCoffee(): int { $totalCoffee = 0; foreach ($this->workers as $worker) { $totalCoffee += $worker->getCoffee(); } return $totalCoffee; } public function getDepartmentPages(): int { $totalPages = 0; foreach ($this->workers as $worker) { $totalPages += $worker->getPages(); } return $totalPages; } public function getDepartmentName(): string { return $this->name; } public function getWorkers(): array { return $this->workers; } public function getWorker(int $key): AbstractWorker { return $this->workers[$key]; } public function deleteWorker(int $key): void { unset($this->workers[$key]); } public function selectWorkers(string $profession): array { $workersOfCertainProfession = array(); foreach ($this->workers as $worker) { if (get_class($worker) == $profession && $worker->getBoss() == FALSE){ $workersOfCertainProfession[] = $worker; } } return $workersOfCertainProfession; } public function changeBoss(int $oldBoss, int $newBoss) { $this->workers[$oldBoss]->setBoss(FALSE); $this->workers[$newBoss]->setBoss(TRUE); } } class Company { private $departments = array(); public function addDepartment(Department $department): void { $this->departments[] = $department; } public function getDepartments(): array { return $this->departments; } public function getDepartmentCount(): int { return count($this->departments); } } class HiringWorkers { public function addWorkersToDepartment(Department $department, string $profession, int $count, int $rank, bool $isBoss, float $salary, int $coffee): void { if ($profession == Manager::class){ for ($i = 0; $i < $count; $i++){ $department->addWorker(new Manager($rank, $isBoss, $salary, $coffee)); } } elseif ($profession == Marketer::class){ for ($i = 0; $i < $count; $i++){ $department->addWorker(new Marketer($rank, $isBoss, $salary, $coffee)); } } elseif ($profession == Engineer::class){ for ($i = 0; $i < $count; $i++){ $department->addWorker(new Engineer ($rank, $isBoss, $salary, $coffee)); } } elseif ($profession == Analyst::class){ for ($i = 0; $i < $count; $i++){ $department->addWorker(new Analyst ($rank, $isBoss, $salary, $coffee)); } } else { throw new Exception("Введено ошибочное название профессии"); } } } class Tabel { public function printTabel(Company $company): void { $this->printRow("Департамент", "сотр.", "тугр.", "кофе", "стр", "тугр./стр."); echo "\n"; foreach ($company->getDepartments() as $department) { $this->printRow($department->getDepartmentName(), $department->getNumberWorkers(), $department->getDepartmentSalary(), $department->getDepartmentCoffee(), $department->getDepartmentPages(), round($department->getDepartmentSalary() / $department->getDepartmentPages(), 1)); } echo "\n"; $count = 0; $salary = 0; $coffee = 0; $pages = 0; $salaryDividePages = 0; foreach ($company->getDepartments() as $department) { $count += $department->getNumberWorkers(); $salary += $department->getDepartmentSalary(); $coffee += $department->getDepartmentCoffee(); $pages += $department->getDepartmentPages(); $salaryDividePages += round($salary / $pages, 1); } $this->printRow("Всего", $count, $salary, $coffee, $pages, $salaryDividePages); $this->printRow("Среднее", round($count / $company->getDepartmentCount(), 1), round($salary / $company->getDepartmentCount(), 1), round($coffee / $company->getDepartmentCount(), 1), round($pages / $company->getDepartmentCount(), 1), round($salaryDividePages / $company->getDepartmentCount(), 1)); echo "\n"; } private function padLeft($value, $columnLength): void { echo $value; echo str_repeat(" ", $columnLength - mb_strlen($value)); } private function printRow(string $name, $count, $salary, $coffee, $pages, $salaryDividePages): void { $col1 = 15; $col2 = 10; $col3 = 10; $col4 = 8; $col5 = 8; $col6 = 15; echo $this->padLeft($name, $col1) . $this->padLeft($count, $col2) . $this->padLeft($salary, $col3) . $this->padLeft($coffee, $col4) . $this->padLeft($pages, $col5) . $this->padLeft($salaryDividePages, $col6) . "\n"; } } class AnticrisisService { public function cutEngineers(Company $company): void { foreach ($company->getDepartments() as $department) { $workersOfCertainProfession = array(); $workersOfCertainProfession = $department->selectWorkers("Engineer"); if (count($workersOfCertainProfession) == 0){ continue; } do { $numberOfPermutations = 0; for ($i = 0; $i < count($workersOfCertainProfession) - 2; $i++){ if ($workersOfCertainProfession[$i]->getRank() == $workersOfCertainProfession[$i+1]){ $buf = $workersOfCertainProfession[$i]; $workersOfCertainProfession[$i] = $workersOfCertainProfession[$i+1]; $workersOfCertainProfession[$i+1] = $buf; $numberOfPermutations++; } } } while ($numberOfPermutations != 0); $workersOfCertainProfession = array_slice($workersOfCertainProfession, 0, ceil(count($workersOfCertainProfession) / 2.5)); var_dump($workersOfCertainProfession); foreach ($department->getWorkers() as $key => $worker) { if ($worker == $workersOfCertainProfession[0]){ $department->deleteWorker($key); unset($workersOfCertainProfession[0]); sort($workersOfCertainProfession); } } } } public function changeDataAnalytics(Company $company): void { foreach ($company->getDepartments() as $department) { $countOfBasicAnalyst = 0; $keyOfBestAnalyst = 0; $rankOfBestAnalyst = 0; $keyOfWorker = -1; foreach ($department->getWorkers() as $worker) { $keyOfWorker++; if ($worker instanceof Analyst){ $worker->setSalary(1100); $worker->setCoffee(75); if ($worker->getBoss() == FALSE){ $countOfBasicAnalyst++; if ($worker->getRank() > $rankOfBestAnalyst){ $rankOfBestAnalyst = $worker->getRank(); $keyOfBestAnalyst = $keyOfWorker; } } } } if (!($department->getWorker($department->getNumberWorkers()-1) instanceof Analyst) && $countOfBasicAnalyst > 0){ $department->changeBoss($department->getNumberWorkers()-1, $keyOfBestAnalyst); } } } public function increaseManagers(Company $company): void { foreach ($company->getDepartments() as $department) { $manager1RangCount = 0; $manager2RangCount = 0; foreach ($department->getWorkers() as $worker) { if ($worker instanceof Manager && ($worker->getRank() == 1)){ $manager1RangCount++; } elseif ($worker instanceof Manager && ($worker->getRank() == 2)){ $manager2RangCount++; } } $manager1RangCount = ceil($manager1RangCount / 2); $manager2RangCount = ceil($manager2RangCount / 2); foreach ($department->getWorkers() as $worker) { if($manager1RangCount + $manager2RangCount == 0){ break; } if ($worker instanceof Manager && $worker->getRank() == 1 && $manager1RangCount > 0){ $worker->setRank($worker->getRank()+1); $manager1RangCount--; } elseif ($worker instanceof Manager && $worker->getRank() == 2 && $manager2RangCount > 0) { $worker->setRank($worker->getRank()+1); $manager2RangCount--; } } } } } $vektor = new Company; $tabel = new Tabel; $hiringWorkers = new HiringWorkers; $departmentOfProcurement = new Department("Закупок"); $hiringWorkers->addWorkersToDepartment($departmentOfProcurement, "Manager", 9, 1, FALSE, 500, 20); $hiringWorkers->addWorkersToDepartment($departmentOfProcurement, "Manager", 3, 2, FALSE, 500, 20); $hiringWorkers->addWorkersToDepartment($departmentOfProcurement, "Manager", 2, 3, FALSE, 500, 20); $hiringWorkers->addWorkersToDepartment($departmentOfProcurement, "Marketer", 2, 1, FALSE, 400, 15); $hiringWorkers->addWorkersToDepartment($departmentOfProcurement, "Manager", 1, 2, TRUE, 500, 20); $departmentOfSales = new Department("Продаж"); $hiringWorkers->addWorkersToDepartment($departmentOfSales, "Manager", 12, 1, FALSE, 500, 20); $hiringWorkers->addWorkersToDepartment($departmentOfSales, "Marketer", 6, 1, FALSE, 400, 15); $hiringWorkers->addWorkersToDepartment($departmentOfSales, "Analyst", 3, 1, FALSE, 800, 50); $hiringWorkers->addWorkersToDepartment($departmentOfSales, "Analyst", 2, 2, FALSE, 800, 50); $hiringWorkers->addWorkersToDepartment($departmentOfSales, "Marketer", 1, 2, TRUE, 400, 15); $departmentOfAdvertising = new Department("Рекламы"); $hiringWorkers->addWorkersToDepartment($departmentOfAdvertising, "Marketer", 15, 1, FALSE, 400, 15); $hiringWorkers->addWorkersToDepartment($departmentOfAdvertising, "Marketer", 10, 2, FALSE, 400, 15); $hiringWorkers->addWorkersToDepartment($departmentOfAdvertising, "Manager", 8, 1, FALSE, 500, 20); $hiringWorkers->addWorkersToDepartment($departmentOfAdvertising, "Engineer", 2, 1, FALSE, 200, 5); $hiringWorkers->addWorkersToDepartment($departmentOfAdvertising, "Marketer", 1, 3, TRUE, 400, 15); $departmentOfLogistics = new Department("Логистики"); $hiringWorkers->addWorkersToDepartment($departmentOfLogistics, "Manager", 13, 1, FALSE, 500, 20); $hiringWorkers->addWorkersToDepartment($departmentOfLogistics, "Manager", 5, 2, FALSE, 500, 20); $hiringWorkers->addWorkersToDepartment($departmentOfLogistics, "Engineer", 5, 1, FALSE, 200, 5); $hiringWorkers->addWorkersToDepartment($departmentOfLogistics, "Manager", 1, 1, TRUE, 500, 20); $vektor->addDepartment($departmentOfProcurement); $vektor->addDepartment($departmentOfSales); $vektor->addDepartment($departmentOfAdvertising); $vektor->addDepartment($departmentOfLogistics); $anticrisisService = new AnticrisisService; $anticrisisService->increaseManagers($vektor); $tabel->printTabel($vektor);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M91Qi
function name:  (null)
number of ops:  221
compiled vars:  !0 = $vektor, !1 = $tabel, !2 = $hiringWorkers, !3 = $departmentOfProcurement, !4 = $departmentOfSales, !5 = $departmentOfAdvertising, !6 = $departmentOfLogistics, !7 = $anticrisisService
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 -1
          2        DO_ICALL                                                 
  430     3        NEW                                              $9      'Company'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $9
  431     6        NEW                                              $12     'Tabel'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $12
  432     9        NEW                                              $15     'HiringWorkers'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !2, $15
  434    12        NEW                                              $18     'Department'
         13        SEND_VAL_EX                                              '%D0%97%D0%B0%D0%BA%D1%83%D0%BF%D0%BE%D0%BA'
         14        DO_FCALL                                      0          
         15        ASSIGN                                                   !3, $18
  435    16        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
         17        SEND_VAR_EX                                              !3
         18        SEND_VAL_EX                                              'Manager'
         19        SEND_VAL_EX                                              9
         20        SEND_VAL_EX                                              1
         21        SEND_VAL_EX                                              <false>
         22        SEND_VAL_EX                                              500
         23        SEND_VAL_EX                                              20
         24        DO_FCALL                                      0          
  436    25        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
         26        SEND_VAR_EX                                              !3
         27        SEND_VAL_EX                                              'Manager'
         28        SEND_VAL_EX                                              3
         29        SEND_VAL_EX                                              2
         30        SEND_VAL_EX                                              <false>
         31        SEND_VAL_EX                                              500
         32        SEND_VAL_EX                                              20
         33        DO_FCALL                                      0          
  437    34        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
         35        SEND_VAR_EX                                              !3
         36        SEND_VAL_EX                                              'Manager'
         37        SEND_VAL_EX                                              2
         38        SEND_VAL_EX                                              3
         39        SEND_VAL_EX                                              <false>
         40        SEND_VAL_EX                                              500
         41        SEND_VAL_EX                                              20
         42        DO_FCALL                                      0          
  438    43        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
         44        SEND_VAR_EX                                              !3
         45        SEND_VAL_EX                                              'Marketer'
         46        SEND_VAL_EX                                              2
         47        SEND_VAL_EX                                              1
         48        SEND_VAL_EX                                              <false>
         49        SEND_VAL_EX                                              400
         50        SEND_VAL_EX                                              15
         51        DO_FCALL                                      0          
  439    52        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
         53        SEND_VAR_EX                                              !3
         54        SEND_VAL_EX                                              'Manager'
         55        SEND_VAL_EX                                              1
         56        SEND_VAL_EX                                              2
         57        SEND_VAL_EX                                              <true>
         58        SEND_VAL_EX                                              500
         59        SEND_VAL_EX                                              20
         60        DO_FCALL                                      0          
  441    61        NEW                                              $26     'Department'
         62        SEND_VAL_EX                                              '%D0%9F%D1%80%D0%BE%D0%B4%D0%B0%D0%B6'
         63        DO_FCALL                                      0          
         64        ASSIGN                                                   !4, $26
  442    65        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
         66        SEND_VAR_EX                                              !4
         67        SEND_VAL_EX                                              'Manager'
         68        SEND_VAL_EX                                              12
         69        SEND_VAL_EX                                              1
         70        SEND_VAL_EX                                              <false>
         71        SEND_VAL_EX                                              500
         72        SEND_VAL_EX                                              20
         73        DO_FCALL                                      0          
  443    74        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
         75        SEND_VAR_EX                                              !4
         76        SEND_VAL_EX                                              'Marketer'
         77        SEND_VAL_EX                                              6
         78        SEND_VAL_EX                                              1
         79        SEND_VAL_EX                                              <false>
         80        SEND_VAL_EX                                              400
         81        SEND_VAL_EX                                              15
         82        DO_FCALL                                      0          
  444    83        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
         84        SEND_VAR_EX                                              !4
         85        SEND_VAL_EX                                              'Analyst'
         86        SEND_VAL_EX                                              3
         87        SEND_VAL_EX                                              1
         88        SEND_VAL_EX                                              <false>
         89        SEND_VAL_EX                                              800
         90        SEND_VAL_EX                                              50
         91        DO_FCALL                                      0          
  445    92        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
         93        SEND_VAR_EX                                              !4
         94        SEND_VAL_EX                                              'Analyst'
         95        SEND_VAL_EX                                              2
         96        SEND_VAL_EX                                              2
         97        SEND_VAL_EX                                              <false>
         98        SEND_VAL_EX                                              800
         99        SEND_VAL_EX                                              50
        100        DO_FCALL                                      0          
  446   101        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
        102        SEND_VAR_EX                                              !4
        103        SEND_VAL_EX                                              'Marketer'
        104        SEND_VAL_EX                                              1
        105        SEND_VAL_EX                                              2
        106        SEND_VAL_EX                                              <true>
        107        SEND_VAL_EX                                              400
        108        SEND_VAL_EX                                              15
        109        DO_FCALL                                      0          
  448   110        NEW                                              $34     'Department'
        111        SEND_VAL_EX                                              '%D0%A0%D0%B5%D0%BA%D0%BB%D0%B0%D0%BC%D1%8B'
        112        DO_FCALL                                      0          
        113        ASSIGN                                                   !5, $34
  449   114        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
        115        SEND_VAR_EX                                              !5
        116        SEND_VAL_EX                                              'Marketer'
        117        SEND_VAL_EX                                              15
        118        SEND_VAL_EX                                              1
        119        SEND_VAL_EX                                              <false>
        120        SEND_VAL_EX                                              400
        121        SEND_VAL_EX                                              15
        122        DO_FCALL                                      0          
  450   123        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
        124        SEND_VAR_EX                                              !5
        125        SEND_VAL_EX                                              'Marketer'
        126        SEND_VAL_EX                                              10
        127        SEND_VAL_EX                                              2
        128        SEND_VAL_EX                                              <false>
        129        SEND_VAL_EX                                              400
        130        SEND_VAL_EX                                              15
        131        DO_FCALL                                      0          
  451   132        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
        133        SEND_VAR_EX                                              !5
        134        SEND_VAL_EX                                              'Manager'
        135        SEND_VAL_EX                                              8
        136        SEND_VAL_EX                                              1
        137        SEND_VAL_EX                                              <false>
        138        SEND_VAL_EX                                              500
        139        SEND_VAL_EX                                              20
        140        DO_FCALL                                      0          
  452   141        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
        142        SEND_VAR_EX                                              !5
        143        SEND_VAL_EX                                              'Engineer'
        144        SEND_VAL_EX                                              2
        145        SEND_VAL_EX                                              1
        146        SEND_VAL_EX                                              <false>
        147        SEND_VAL_EX                                              200
        148        SEND_VAL_EX                                              5
        149        DO_FCALL                                      0          
  453   150        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
        151        SEND_VAR_EX                                              !5
        152        SEND_VAL_EX                                              'Marketer'
        153        SEND_VAL_EX                                              1
        154        SEND_VAL_EX                                              3
        155        SEND_VAL_EX                                              <true>
        156        SEND_VAL_EX                                              400
        157        SEND_VAL_EX                                              15
        158        DO_FCALL                                      0          
  455   159        NEW                                              $42     'Department'
        160        SEND_VAL_EX                                              '%D0%9B%D0%BE%D0%B3%D0%B8%D1%81%D1%82%D0%B8%D0%BA%D0%B8'
        161        DO_FCALL                                      0          
        162        ASSIGN                                                   !6, $42
  456   163        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
        164        SEND_VAR_EX                                              !6
        165        SEND_VAL_EX                                              'Manager'
        166        SEND_VAL_EX                                              13
        167        SEND_VAL_EX                                              1
        168        SEND_VAL_EX                                              <false>
        169        SEND_VAL_EX                                              500
        170        SEND_VAL_EX                                              20
        171        DO_FCALL                                      0          
  457   172        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
        173        SEND_VAR_EX                                              !6
        174        SEND_VAL_EX                                              'Manager'
        175        SEND_VAL_EX                                              5
        176        SEND_VAL_EX                                              2
        177        SEND_VAL_EX                                              <false>
        178        SEND_VAL_EX                                              500
        179        SEND_VAL_EX                                              20
        180        DO_FCALL                                      0          
  458   181        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
        182        SEND_VAR_EX                                              !6
        183        SEND_VAL_EX                                              'Engineer'
        184        SEND_VAL_EX                                              5
        185        SEND_VAL_EX                                              1
        186        SEND_VAL_EX                                              <false>
        187        SEND_VAL_EX                                              200
        188        SEND_VAL_EX                                              5
        189        DO_FCALL                                      0          
  459   190        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
        191        SEND_VAR_EX                                              !6
        192        SEND_VAL_EX                                              'Manager'
        193        SEND_VAL_EX                                              1
        194        SEND_VAL_EX                                              1
        195        SEND_VAL_EX                                              <true>
        196        SEND_VAL_EX                                              500
        197        SEND_VAL_EX                                              20
        198        DO_FCALL                                      0          
  461   199        INIT_METHOD_CALL                                         !0, 'addDepartment'
        200        SEND_VAR_EX                                              !3
        201        DO_FCALL                                      0          
  462   202        INIT_METHOD_CALL                                         !0, 'addDepartment'
        203        SEND_VAR_EX                                              !4
        204        DO_FCALL                                      0          
  463   205        INIT_METHOD_CALL                                         !0, 'addDepartment'
        206        SEND_VAR_EX                                              !5
        207        DO_FCALL                                      0          
  464   208        INIT_METHOD_CALL                                         !0, 'addDepartment'
        209        SEND_VAR_EX                                              !6
        210        DO_FCALL                                      0          
  466   211        NEW                                              $53     'AnticrisisService'
        212        DO_FCALL                                      0          
        213        ASSIGN                                                   !7, $53
  467   214        INIT_METHOD_CALL                                         !7, 'increaseManagers'
        215        SEND_VAR_EX                                              !0
        216        DO_FCALL                                      0          
  469   217        INIT_METHOD_CALL                                         !1, 'printTabel'
        218        SEND_VAR_EX                                              !0
        219        DO_FCALL                                      0          
        220      > RETURN                                                   1

Class AbstractWorker:
Function getbasicpages:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M91Qi
function name:  getBasicPages
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   VERIFY_RETURN_TYPE                                       
          1      > RETURN                                                   null

End of function getbasicpages

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M91Qi
function name:  __construct
number of ops:  13
compiled vars:  !0 = $rank, !1 = $isBoss, !2 = $salary, !3 = $coffee
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   16     4        ASSIGN_OBJ                                               'rank'
          5        OP_DATA                                                  !0
   17     6        ASSIGN_OBJ                                               'isBoss'
          7        OP_DATA                                                  !1
   18     8        ASSIGN_OBJ                                               'coffee'
          9        OP_DATA                                                  !3
   19    10        ASSIGN_OBJ                                               'salary'
         11        OP_DATA                                                  !2
   20    12      > RETURN                                                   null

End of function __construct

Function getrank:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M91Qi
function name:  getRank
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   FETCH_OBJ_R                                      ~0      'rank'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   25     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getrank

Function setrank:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M91Qi
function name:  setRank
number of ops:  4
compiled vars:  !0 = $rank
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
   29     1        ASSIGN_OBJ                                               'rank'
          2        OP_DATA                                                  !0
   30     3      > RETURN                                                   null

End of function setrank

Function getboss:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M91Qi
function name:  getBoss
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   FETCH_OBJ_R                                      ~0      'isBoss'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   35     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getboss

Function setboss:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M91Qi
function name:  setBoss
number of ops:  4
compiled vars:  !0 = $isBoss
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E >   RECV                                             !0      
   39     1        ASSIGN_OBJ                                               'isBoss'
          2        OP_DATA                                                  !0
   40     3      > RETURN                                                   null

End of function setboss

Function getsalary:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
Branch analysis from position: 14
Branch analysis from position: 11
filename:       /in/M91Qi
function name:  getSalary
number of ops:  18
compiled vars:  !0 = $modifiedSalary
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   44     0  E >   FETCH_OBJ_R                                      ~1      'salary'
          1        ASSIGN                                                   !0, ~1
   46     2        FETCH_OBJ_R                                      ~3      'rank'
          3        IS_EQUAL                                                 ~3, 2
          4      > JMPZ                                                     ~4, ->7
   47     5    >   ASSIGN_OP                                     3          !0, 1.25
          6      > JMP                                                      ->11
   48     7    >   FETCH_OBJ_R                                      ~6      'rank'
          8        IS_EQUAL                                                 ~6, 3
          9      > JMPZ                                                     ~7, ->11
   49    10    >   ASSIGN_OP                                     3          !0, 1.5
   52    11    >   FETCH_OBJ_R                                      ~9      'isBoss'
         12      > JMPZ                                                     ~9, ->14
   53    13    >   ASSIGN_OP                                     3          !0, 1.5
   56    14    >   VERIFY_RETURN_TYPE                                       !0
         15      > RETURN                                                   !0
   57    16*       VERIFY_RETURN_TYPE                                       
         17*     > RETURN                                                   null

End of function getsalary

Function getcoffee:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/M91Qi
function name:  getCoffee
number of ops:  9
compiled vars:  !0 = $modifiedCoffee
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   61     0  E >   FETCH_OBJ_R                                      ~1      'coffee'
          1        ASSIGN                                                   !0, ~1
   63     2        FETCH_OBJ_R                                      ~3      'isBoss'
          3      > JMPZ                                                     ~3, ->5
   64     4    >   ASSIGN_OP                                     3          !0, 2
   67     5    >   VERIFY_RETURN_TYPE                                       !0
          6      > RETURN                                                   !0
   68     7*       VERIFY_RETURN_TYPE                                       
          8*     > RETURN                                                   null

End of function getcoffee

Function getpages:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/M91Qi
function name:  getPages
number of ops:  10
compiled vars:  !0 = $pages
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   72     0  E >   INIT_METHOD_CALL                                         'getBasicPages'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   74     3        FETCH_OBJ_R                                      ~3      'isBoss'
          4      > JMPZ                                                     ~3, ->6
   75     5    >   ASSIGN                                                   !0, 0
   78     6    >   VERIFY_RETURN_TYPE                                       !0
          7      > RETURN                                                   !0
   79     8*       VERIFY_RETURN_TYPE                                       
          9*     > RETURN                                                   null

End of function getpages

Function setsalary:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M91Qi
function name:  setSalary
number of ops:  4
compiled vars:  !0 = $salary
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   81     0  E >   RECV                                             !0      
   83     1        ASSIGN_OBJ                                               'salary'
          2        OP_DATA                                                  !0
   84     3      > RETURN                                                   null

End of function setsalary

Function setcoffee:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M91Qi
function name:  setCoffee
number of ops:  4
compiled vars:  !0 = $coffee
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   86     0  E >   RECV                                             !0      
   88     1        ASSIGN_OBJ                                               'coffee'
          2        OP_DATA                                                  !0
   89     3      > RETURN                                                   null

End of function setcoffee

End of class AbstractWorker.

Class Manager:
Function getbasicpages:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M91Qi
function name:  getBasicPages
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   96     0  E > > RETURN                                                   200
   97     1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function getbasicpages

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M91Qi
function name:  __construct
number of ops:  13
compiled vars:  !0 = $rank, !1 = $isBoss, !2 = $salary, !3 = $coffee
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   16     4        ASSIGN_OBJ                                               'rank'
          5        OP_DATA                                                  !0
   17     6        ASSIGN_OBJ                                               'isBoss'
          7        OP_DATA                                                  !1
   18     8        ASSIGN_OBJ                                               'coffee'
          9        OP_DATA                                                  !3
   19    10        ASSIGN_OBJ                                       

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
526.97 ms | 1428 KiB | 18 Q