3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); abstract class AbstractWorker { public $rank; public $isBoss; public function __construct(int $rank, int $isBoss) { $this->rank = $rank; $this->isBoss = $isBoss; } public function getSalary(): float { $salary = $this->getBasicSalary(); if ($this->rank == 2){ $salary *= 1.25; } elseif ($this->rank == 3){ $salary *= 1.5; } if ($this->isBoss == 1){ $salary *= 1.5; } return $salary; } public function getCoffee(): int { $coffee = $this->getBasicCoffee(); if ($this->isBoss == 1){ $coffee *= 2; } return $coffee; } public function getPages(): int { $pages = $this->getBasicPages(); if ($this->isBoss == 1){ $pages = 0; } return $pages; } abstract public function getBasicSalary(): int; abstract public function getBasicCoffee(): int; abstract public function getBasicPages(): int; } class Manager extends AbstractWorker { public function getBasicSalary(): int { return 500; } public function getBasicCoffee(): int { return 20; } public function getBasicPages(): int { return 200; } } class Marketer extends AbstractWorker { public function getBasicSalary(): int { return 400; } public function getBasicCoffee(): int { return 15; } public function getBasicPages(): int { return 150; } } class Engineer extends AbstractWorker { public function getBasicSalary(): int { return 200; } public function getBasicCoffee(): int { return 5; } public function getBasicPages(): int { return 50; } } class Analyst extends AbstractWorker { public function getBasicSalary(): int { return 800; } public function getBasicCoffee(): int { return 50; } public function getBasicPages(): int { return 5; } } class Department { private $name; private $workers = array(); public function __construct(string $name) { $this->name = $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 $number): AbstractWorker { return $this->workers[$number]; } public function deleteWorker(int $number): void { unset($this->workers[$number]); } public function sortWorkers(): void { sort($this->workers); } } 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 Tabel { 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"; } 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)); } } class HiringWorkers { public function addWorkersToDepartment(Department $department, string $profession, int $count, int $rang, int $isBoss): void { if ($profession == Manager::class){ for ($i = 0; $i < $count; $i++){ $department->addWorker(new Manager($rang, $isBoss)); } } elseif ($profession == Marketer::class){ for ($i = 0; $i < $count; $i++){ $department->addWorker(new Marketer($rang, $isBoss)); } } elseif ($profession == Engineer::class){ for ($i = 0; $i < $count; $i++){ $department->addWorker(new Engineer ($rang, $isBoss)); } } elseif ($profession == Analyst::class){ for ($i = 0; $i < $count; $i++){ $department->addWorker(new Analyst ($rang, $isBoss)); } } } } $vektor = new Company; $tabel = new Tabel; $hiringWorkers = new HiringWorkers; $departmentOfProcurement = new Department("Закупок"); $hiringWorkers->addWorkersToDepartment($departmentOfProcurement, "Manager", 9, 1, 0); $hiringWorkers->addWorkersToDepartment($departmentOfProcurement, "Manager", 3, 2, 0); $hiringWorkers->addWorkersToDepartment($departmentOfProcurement, "Manager", 2, 3, 0); $hiringWorkers->addWorkersToDepartment($departmentOfProcurement, "Marketer", 2, 1, 0); $hiringWorkers->addWorkersToDepartment($departmentOfProcurement, "Manager", 1, 2, 1); $departmentOfSales = new Department("Продаж"); $hiringWorkers->addWorkersToDepartment($departmentOfSales, "Manager", 12, 1, 0); $hiringWorkers->addWorkersToDepartment($departmentOfSales, "Marketer", 6, 1, 0); $hiringWorkers->addWorkersToDepartment($departmentOfSales, "Analyst", 3, 1, 0); $hiringWorkers->addWorkersToDepartment($departmentOfSales, "Analyst", 2, 2, 0); $hiringWorkers->addWorkersToDepartment($departmentOfSales, "Marketer", 1, 2, 1); $departmentOfAdvertising = new Department("Рекламы"); $hiringWorkers->addWorkersToDepartment($departmentOfAdvertising, "Marketer", 15, 1, 0); $hiringWorkers->addWorkersToDepartment($departmentOfAdvertising, "Marketer", 10, 2, 0); $hiringWorkers->addWorkersToDepartment($departmentOfAdvertising, "Manager", 8, 1, 0); $hiringWorkers->addWorkersToDepartment($departmentOfAdvertising, "Engineer", 2, 1, 0); $hiringWorkers->addWorkersToDepartment($departmentOfAdvertising, "Marketer", 1, 3, 1); $departmentOfLogistics = new Department("Логистики"); $hiringWorkers->addWorkersToDepartment($departmentOfLogistics, "Manager", 13, 1, 0); $hiringWorkers->addWorkersToDepartment($departmentOfLogistics, "Manager", 5, 2, 0); $hiringWorkers->addWorkersToDepartment($departmentOfLogistics, "Engineer", 5, 1, 0); $hiringWorkers->addWorkersToDepartment($departmentOfLogistics, "Manager", 1, 1, 1); $vektor->addDepartment($departmentOfProcurement); $vektor->addDepartment($departmentOfSales); $vektor->addDepartment($departmentOfAdvertising); $vektor->addDepartment($departmentOfLogistics); $tabel->printTabel($vektor);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QfVAk
function name:  (null)
number of ops:  177
compiled vars:  !0 = $vektor, !1 = $tabel, !2 = $hiringWorkers, !3 = $departmentOfProcurement, !4 = $departmentOfSales, !5 = $departmentOfAdvertising, !6 = $departmentOfLogistics
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 -1
          2        DO_ICALL                                                 
  322     3        NEW                                              $8      'Company'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $8
  323     6        NEW                                              $11     'Tabel'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $11
  324     9        NEW                                              $14     'HiringWorkers'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !2, $14
  326    12        NEW                                              $17     '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, $17
  327    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                                              0
         22        DO_FCALL                                      0          
  328    23        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
         24        SEND_VAR_EX                                              !3
         25        SEND_VAL_EX                                              'Manager'
         26        SEND_VAL_EX                                              3
         27        SEND_VAL_EX                                              2
         28        SEND_VAL_EX                                              0
         29        DO_FCALL                                      0          
  329    30        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
         31        SEND_VAR_EX                                              !3
         32        SEND_VAL_EX                                              'Manager'
         33        SEND_VAL_EX                                              2
         34        SEND_VAL_EX                                              3
         35        SEND_VAL_EX                                              0
         36        DO_FCALL                                      0          
  330    37        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
         38        SEND_VAR_EX                                              !3
         39        SEND_VAL_EX                                              'Marketer'
         40        SEND_VAL_EX                                              2
         41        SEND_VAL_EX                                              1
         42        SEND_VAL_EX                                              0
         43        DO_FCALL                                      0          
  331    44        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
         45        SEND_VAR_EX                                              !3
         46        SEND_VAL_EX                                              'Manager'
         47        SEND_VAL_EX                                              1
         48        SEND_VAL_EX                                              2
         49        SEND_VAL_EX                                              1
         50        DO_FCALL                                      0          
  333    51        NEW                                              $25     'Department'
         52        SEND_VAL_EX                                              '%D0%9F%D1%80%D0%BE%D0%B4%D0%B0%D0%B6'
         53        DO_FCALL                                      0          
         54        ASSIGN                                                   !4, $25
  334    55        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
         56        SEND_VAR_EX                                              !4
         57        SEND_VAL_EX                                              'Manager'
         58        SEND_VAL_EX                                              12
         59        SEND_VAL_EX                                              1
         60        SEND_VAL_EX                                              0
         61        DO_FCALL                                      0          
  335    62        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
         63        SEND_VAR_EX                                              !4
         64        SEND_VAL_EX                                              'Marketer'
         65        SEND_VAL_EX                                              6
         66        SEND_VAL_EX                                              1
         67        SEND_VAL_EX                                              0
         68        DO_FCALL                                      0          
  336    69        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
         70        SEND_VAR_EX                                              !4
         71        SEND_VAL_EX                                              'Analyst'
         72        SEND_VAL_EX                                              3
         73        SEND_VAL_EX                                              1
         74        SEND_VAL_EX                                              0
         75        DO_FCALL                                      0          
  337    76        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
         77        SEND_VAR_EX                                              !4
         78        SEND_VAL_EX                                              'Analyst'
         79        SEND_VAL_EX                                              2
         80        SEND_VAL_EX                                              2
         81        SEND_VAL_EX                                              0
         82        DO_FCALL                                      0          
  338    83        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
         84        SEND_VAR_EX                                              !4
         85        SEND_VAL_EX                                              'Marketer'
         86        SEND_VAL_EX                                              1
         87        SEND_VAL_EX                                              2
         88        SEND_VAL_EX                                              1
         89        DO_FCALL                                      0          
  340    90        NEW                                              $33     'Department'
         91        SEND_VAL_EX                                              '%D0%A0%D0%B5%D0%BA%D0%BB%D0%B0%D0%BC%D1%8B'
         92        DO_FCALL                                      0          
         93        ASSIGN                                                   !5, $33
  341    94        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
         95        SEND_VAR_EX                                              !5
         96        SEND_VAL_EX                                              'Marketer'
         97        SEND_VAL_EX                                              15
         98        SEND_VAL_EX                                              1
         99        SEND_VAL_EX                                              0
        100        DO_FCALL                                      0          
  342   101        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
        102        SEND_VAR_EX                                              !5
        103        SEND_VAL_EX                                              'Marketer'
        104        SEND_VAL_EX                                              10
        105        SEND_VAL_EX                                              2
        106        SEND_VAL_EX                                              0
        107        DO_FCALL                                      0          
  343   108        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
        109        SEND_VAR_EX                                              !5
        110        SEND_VAL_EX                                              'Manager'
        111        SEND_VAL_EX                                              8
        112        SEND_VAL_EX                                              1
        113        SEND_VAL_EX                                              0
        114        DO_FCALL                                      0          
  344   115        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
        116        SEND_VAR_EX                                              !5
        117        SEND_VAL_EX                                              'Engineer'
        118        SEND_VAL_EX                                              2
        119        SEND_VAL_EX                                              1
        120        SEND_VAL_EX                                              0
        121        DO_FCALL                                      0          
  345   122        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
        123        SEND_VAR_EX                                              !5
        124        SEND_VAL_EX                                              'Marketer'
        125        SEND_VAL_EX                                              1
        126        SEND_VAL_EX                                              3
        127        SEND_VAL_EX                                              1
        128        DO_FCALL                                      0          
  347   129        NEW                                              $41     'Department'
        130        SEND_VAL_EX                                              '%D0%9B%D0%BE%D0%B3%D0%B8%D1%81%D1%82%D0%B8%D0%BA%D0%B8'
        131        DO_FCALL                                      0          
        132        ASSIGN                                                   !6, $41
  348   133        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
        134        SEND_VAR_EX                                              !6
        135        SEND_VAL_EX                                              'Manager'
        136        SEND_VAL_EX                                              13
        137        SEND_VAL_EX                                              1
        138        SEND_VAL_EX                                              0
        139        DO_FCALL                                      0          
  349   140        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
        141        SEND_VAR_EX                                              !6
        142        SEND_VAL_EX                                              'Manager'
        143        SEND_VAL_EX                                              5
        144        SEND_VAL_EX                                              2
        145        SEND_VAL_EX                                              0
        146        DO_FCALL                                      0          
  350   147        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
        148        SEND_VAR_EX                                              !6
        149        SEND_VAL_EX                                              'Engineer'
        150        SEND_VAL_EX                                              5
        151        SEND_VAL_EX                                              1
        152        SEND_VAL_EX                                              0
        153        DO_FCALL                                      0          
  351   154        INIT_METHOD_CALL                                         !2, 'addWorkersToDepartment'
        155        SEND_VAR_EX                                              !6
        156        SEND_VAL_EX                                              'Manager'
        157        SEND_VAL_EX                                              1
        158        SEND_VAL_EX                                              1
        159        SEND_VAL_EX                                              1
        160        DO_FCALL                                      0          
  353   161        INIT_METHOD_CALL                                         !0, 'addDepartment'
        162        SEND_VAR_EX                                              !3
        163        DO_FCALL                                      0          
  354   164        INIT_METHOD_CALL                                         !0, 'addDepartment'
        165        SEND_VAR_EX                                              !4
        166        DO_FCALL                                      0          
  355   167        INIT_METHOD_CALL                                         !0, 'addDepartment'
        168        SEND_VAR_EX                                              !5
        169        DO_FCALL                                      0          
  356   170        INIT_METHOD_CALL                                         !0, 'addDepartment'
        171        SEND_VAR_EX                                              !6
        172        DO_FCALL                                      0          
  358   173        INIT_METHOD_CALL                                         !1, 'printTabel'
        174        SEND_VAR_EX                                              !0
        175        DO_FCALL                                      0          
        176      > RETURN                                                   1

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

End of function __construct

Function getsalary:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
Branch analysis from position: 16
Branch analysis from position: 12
filename:       /in/QfVAk
function name:  getSalary
number of ops:  20
compiled vars:  !0 = $salary
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_METHOD_CALL                                         'getBasicSalary'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   20     3        FETCH_OBJ_R                                      ~3      'rank'
          4        IS_EQUAL                                                 ~3, 2
          5      > JMPZ                                                     ~4, ->8
   21     6    >   ASSIGN_OP                                     3          !0, 1.25
          7      > JMP                                                      ->12
   22     8    >   FETCH_OBJ_R                                      ~6      'rank'
          9        IS_EQUAL                                                 ~6, 3
         10      > JMPZ                                                     ~7, ->12
   23    11    >   ASSIGN_OP                                     3          !0, 1.5
   26    12    >   FETCH_OBJ_R                                      ~9      'isBoss'
         13        IS_EQUAL                                                 ~9, 1
         14      > JMPZ                                                     ~10, ->16
   27    15    >   ASSIGN_OP                                     3          !0, 1.5
   30    16    >   VERIFY_RETURN_TYPE                                       !0
         17      > RETURN                                                   !0
   31    18*       VERIFY_RETURN_TYPE                                       
         19*     > RETURN                                                   null

End of function getsalary

Function getcoffee:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/QfVAk
function name:  getCoffee
number of ops:  11
compiled vars:  !0 = $coffee
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   INIT_METHOD_CALL                                         'getBasicCoffee'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   37     3        FETCH_OBJ_R                                      ~3      'isBoss'
          4        IS_EQUAL                                                 ~3, 1
          5      > JMPZ                                                     ~4, ->7
   38     6    >   ASSIGN_OP                                     3          !0, 2
   41     7    >   VERIFY_RETURN_TYPE                                       !0
          8      > RETURN                                                   !0
   42     9*       VERIFY_RETURN_TYPE                                       
         10*     > RETURN                                                   null

End of function getcoffee

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

End of function getpages

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

End of function getbasicsalary

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

End of function getbasiccoffee

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

End of function getbasicpages

End of class AbstractWorker.

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

End of function getbasicsalary

Function getbasiccoffee:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QfVAk
function name:  getBasicCoffee
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   69     0  E > > RETURN                                                   20
   70     1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function getbasiccoffee

Function getbasicpages:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QfVAk
function name:  getBasicPages
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   74     0  E > > RETURN                                                   200
   75     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/QfVAk
function name:  __construct
number of ops:  7
compiled vars:  !0 = $rank, !1 = $isBoss
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        ASSIGN_OBJ                                               'rank'
          3        OP_DATA                                                  !0
   13     4        ASSIGN_OBJ                                               'isBoss'
          5        OP_DATA                                                  !1
   14     6      > RETURN                                                   null

End of function __construct

Function getsalary:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
Branch analysis from position: 16
Branch analysis from position: 12
filename:       /in/QfVAk
function name:  getSalary
number of ops:  20
compiled vars:  !0 = $salary
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_METHOD_CALL                                         'getBasicSalary'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   20     3        FETCH_OBJ_R                                      ~3      'rank'
          4        IS_EQUAL                                                 ~3, 2
          5      > JMPZ                                                     ~4, ->8
   21     6    >   ASSIGN_OP                                     3          !0, 1.25
          7      > JMP                                                      ->12
   22     8    >   FETCH_OBJ_R                                      ~6      'rank'
          9        IS_EQUAL                                                 ~6, 3
         10      > JMPZ                                                     ~7, ->12
   23    11    >   ASSIGN_OP                                     3          !0, 1.5
   26    12    >   FETCH_OBJ_R                                      ~9      'isBoss'
         13        IS_EQUAL                                                 ~9, 1
         14      > JMPZ                                                     ~10, ->16
   27    15    >   ASSIGN_OP                                     3          !0, 1.5
   30    16    >   VERIFY_RETURN_TYPE                                       !0
         17      > RETURN                                                   !0
   31    18*       VERIFY_RETURN_TYPE                                       
         19*     > RETURN                                                   null

End of function getsalary

Function getcoffee:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/QfVAk
function name:  getCoffee
number of ops:  11
compiled vars:  !0 = $coffee
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   INIT_METHOD_CALL                                         'getBasicCoffee'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   37     3        FETCH_OBJ_R                                      ~3      'isBoss'
          4        IS_EQUAL                                                 ~3, 1
          5      > JMPZ                                                     ~4, ->7
   38     6    >   ASSIGN_OP                                     3          !0, 2
   41     7    >   VERIFY_RETURN_TYPE                                       !0
          8      > RETURN                                                   !0
   42     9*       VERIFY_RETURN_TYPE                                       
         10*     > RETURN                                                   null

End of function getcoffee

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

End of function getpages

End of class Manager.

Class Marketer:
Function getbasicsalary:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QfVAk
function name:  getBasicSalary
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   82     0  E > > RETURN                                                   400
   83     1*       VERIFY_RETURN_TYPE                                       
          2*     > RET

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
246.79 ms | 1433 KiB | 16 Q