3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); abstract class AbstractWorker{ public $rank; public $isBoss; public $coffee; public $salary; public $pages; public function __construct( $rank, $isBoss) { $this->rank = $rank; $this->isBoss = $isBoss; } public function getSalary(){ $salary = $this->salary; if ($this->rank == 2){ $salary = $this->salary * 1.25; } elseif ($this->rank == 3){ $salary = $this->salary * 1.5; } return $salary; } public function getCoffee(){ $coffee = $this->coffee; if ($this->isBoss == 1){ $coffee = $this->coffee * 2; } return $coffee; } public function getPages(){ $pages = $this->pages; if ($this->isBoss == 1){ $pages = $this->pages * 0; } return $pages; } } class Manager extends AbstractWorker{ public $coffee = 20; public $salary = 500; public $pages = 200; } class Marketer extends AbstractWorker{ public $coffee = 15; public $salary = 400; public $pages = 150; } class Engineer extends AbstractWorker{ public $coffee = 5; public $salary = 200; public $pages = 50; } class Analyst extends AbstractWorker{ public $coffee = 50; public $salary = 800; public $pages = 5; } class Department{ public $name; public $workers = array(); public function __construct($name) { $this->name = $name; } public function addWorker(AbstractWorker $worker){ $this->workers[] = $worker; } public function getNumberWorkers(){ return count($this->workers); } public function getDepartmentSalary(){ $totalSalary = 0; foreach ($this->workers as $worker) { $totalSalary += $worker->getSalary(); } return $totalSalary; } public function getDepartmentCoffee(){ $totalCoffee = 0; foreach ($this->workers as $worker) { $totalCoffee += $worker->getCoffee(); } return $totalCoffee; } public function getDepartmentPages(){ $totalPages = 0; foreach ($this->workers as $worker) { $totalPages += $worker->getPages(); } return $totalPages; } // public function getWorkers(){ // return $this->workers; // } public function getDepartmentName(){ return $this->name; } public function addWorkersToDepartment(string $profession, int $count, int $rang, int $isBoss){ if ($profession == "Manager"){ for ($i = 0; $i < $count; $i++){ //$this->addWorker(Manager $worker($rang, $isBoss)); $this->addWorker(new Manager($rang, $isBoss)); } } elseif ($profession == "Marketer"){ for ($i = 0; $i < $count; $i++){ $this->addWorker(new Marketer($rang, $isBoss)); } } elseif ($profession == "Engineer"){ for ($i = 0; $i < $count; $i++){ $this->addWorker(new Engineer ($rang, $isBoss)); } } elseif ($profession == "Analyst"){ for ($i = 0; $i < $count; $i++){ $this->addWorker(new Engineer ($rang, $isBoss)); } } } } class Company{ public $departments = array(); public function addDepartment(Department $department){ $this->departments[] = $department; } public function getDepartments(){ return $this->departments; } public function getDepartmentCount(){ return count($this->departments); } } class Tabel{ private function padLeft($value, $columnLength){ echo $value; echo str_repeat(" ", $columnLength - mb_strlen($value)); } private function calculatiotOfOutput(array $informarion){ $col1 = 15; $col2 = 10; $col3 = 10; $col4 = 8; $col5 = 8; $col6 = 15; echo $this->padLeft($informarion["name"], $col1) . $this->padLeft($informarion["count"], $col2) . $this->padLeft($informarion["salary"], $col3) . $this->padLeft($informarion["coffee"], $col4) . $this->padLeft($informarion["pages"], $col5) . $this->padLeft($informarion["salaryDividePages"], $col6) . "\n"; } public function printTabel(Company $company){ $columnName = array("name" => "Департамент", "count" => "сотр.", "salary" => "тугр.", "coffee" => "кофе", "pages" => "стр.", "salaryDividePages" => "тугр./стр."); $this->calculatiotOfOutput($columnName); $information = array("name" => "", "count" => 0, "salary" => 0, "coffee" => 0, "pages" => 0, "salaryDividePages" => 0); foreach ($company->getDepartments() as $department) { $information["name"] = $department->getDepartmentName(); $information["count"] = $department->getNumberWorkers(); $information["salary"] = $department->getDepartmentSalary(); $information["coffee"] = $department->getDepartmentCoffee(); $information["pages"] = $department->getDepartmentPages(); $information["salaryDividePages"] = round($department->getDepartmentSalary() / $department->getDepartmentPages(), 1); $this->calculatiotOfOutput($information); } echo "\n"; $totalInformation = array("name" => "Всего", "count" => 0, "salary" => 0, "coffee" => 0, "pages" => 0, "salaryDividePages" => 0); $totalInformation["name"] = "Всего"; foreach ($company->getDepartments() as $department) { $totalInformation["count"] += $department->getNumberWorkers(); $totalInformation["salary"] += $department->getDepartmentSalary(); $totalInformation["coffee"] += $department->getDepartmentCoffee(); $totalInformation["pages"] += $department->getDepartmentPages(); } $totalInformarion["salaryDividePages"] = round($totalInformation["salary"] / $totalInformation["pages"], 1); $this->calculatiotOfOutput($totalInformation); $averageInformation = array("name" => "Среднее", "count" => $totalInformation["count"] / $company->getDepartmentCount(), "salary" => $totalInformation["salary"] / $company->getDepartmentCount(), "coffee" => $totalInformation["coffee"] / $company->getDepartmentCount(), "pages" => $totalInformation["pages"] / $company->getDepartmentCount(), "salaryDividePages" => $totalInformation["salaryDividePages"] / $company->getDepartmentCount()); $this->calculatiotOfOutput($averageInformation); } } $vektor = new Company; $zakupki = new Department("Запуки"); $zakupki->addWorkersToDepartment("Manager", 5, 2, 0); $vektor->addDepartment($zakupki); $tabel = new Tabel; $tabel->printTabel($vektor);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/X8vcH
function name:  (null)
number of ops:  26
compiled vars:  !0 = $vektor, !1 = $zakupki, !2 = $tabel
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 -1
          2        DO_ICALL                                                 
  252     3        NEW                                              $4      'Company'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $4
  254     6        NEW                                              $7      'Department'
          7        SEND_VAL_EX                                              '%D0%97%D0%B0%D0%BF%D1%83%D0%BA%D0%B8'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $7
  255    10        INIT_METHOD_CALL                                         !1, 'addWorkersToDepartment'
         11        SEND_VAL_EX                                              'Manager'
         12        SEND_VAL_EX                                              5
         13        SEND_VAL_EX                                              2
         14        SEND_VAL_EX                                              0
         15        DO_FCALL                                      0          
  257    16        INIT_METHOD_CALL                                         !0, 'addDepartment'
         17        SEND_VAR_EX                                              !1
         18        DO_FCALL                                      0          
  259    19        NEW                                              $12     'Tabel'
         20        DO_FCALL                                      0          
         21        ASSIGN                                                   !2, $12
  261    22        INIT_METHOD_CALL                                         !2, 'printTabel'
         23        SEND_VAR_EX                                              !0
         24        DO_FCALL                                      0          
         25      > RETURN                                                   1

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

End of function __construct

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

End of function getsalary

Function getcoffee:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/X8vcH
function name:  getCoffee
number of ops:  10
compiled vars:  !0 = $coffee
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   FETCH_OBJ_R                                      ~1      'coffee'
          1        ASSIGN                                                   !0, ~1
   32     2        FETCH_OBJ_R                                      ~3      'isBoss'
          3        IS_EQUAL                                                 ~3, 1
          4      > JMPZ                                                     ~4, ->8
   33     5    >   FETCH_OBJ_R                                      ~5      'coffee'
          6        MUL                                              ~6      ~5, 2
          7        ASSIGN                                                   !0, ~6
   36     8    > > RETURN                                                   !0
   37     9*     > 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 = 8
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/X8vcH
function name:  getPages
number of ops:  10
compiled vars:  !0 = $pages
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   FETCH_OBJ_R                                      ~1      'pages'
          1        ASSIGN                                                   !0, ~1
   42     2        FETCH_OBJ_R                                      ~3      'isBoss'
          3        IS_EQUAL                                                 ~3, 1
          4      > JMPZ                                                     ~4, ->8
   43     5    >   FETCH_OBJ_R                                      ~5      'pages'
          6        MUL                                              ~6      ~5, 0
          7        ASSIGN                                                   !0, ~6
   46     8    > > RETURN                                                   !0
   47     9*     > RETURN                                                   null

End of function getpages

End of class AbstractWorker.

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

End of function __construct

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

End of function getsalary

Function getcoffee:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/X8vcH
function name:  getCoffee
number of ops:  10
compiled vars:  !0 = $coffee
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   FETCH_OBJ_R                                      ~1      'coffee'
          1        ASSIGN                                                   !0, ~1
   32     2        FETCH_OBJ_R                                      ~3      'isBoss'
          3        IS_EQUAL                                                 ~3, 1
          4      > JMPZ                                                     ~4, ->8
   33     5    >   FETCH_OBJ_R                                      ~5      'coffee'
          6        MUL                                              ~6      ~5, 2
          7        ASSIGN                                                   !0, ~6
   36     8    > > RETURN                                                   !0
   37     9*     > 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 = 8
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/X8vcH
function name:  getPages
number of ops:  10
compiled vars:  !0 = $pages
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   FETCH_OBJ_R                                      ~1      'pages'
          1        ASSIGN                                                   !0, ~1
   42     2        FETCH_OBJ_R                                      ~3      'isBoss'
          3        IS_EQUAL                                                 ~3, 1
          4      > JMPZ                                                     ~4, ->8
   43     5    >   FETCH_OBJ_R                                      ~5      'pages'
          6        MUL                                              ~6      ~5, 0
          7        ASSIGN                                                   !0, ~6
   46     8    > > RETURN                                                   !0
   47     9*     > RETURN                                                   null

End of function getpages

End of class Manager.

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

End of function __construct

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

End of function getsalary

Function getcoffee:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/X8vcH
function name:  getCoffee
number of ops:  10
compiled vars:  !0 = $coffee
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   FETCH_OBJ_R                                      ~1      'coffee'
          1        ASSIGN                                                   !0, ~1
   32     2        FETCH_OBJ_R                                      ~3      'isBoss'
          3        IS_EQUAL                                                 ~3, 1
          4      > JMPZ                                                     ~4, ->8
   33     5    >   FETCH_OBJ_R                                      ~5      'coffee'
          6        MUL                                              ~6      ~5, 2
          7        ASSIGN                                                   !0, ~6
   36     8    > > RETURN                                                   !0
   37     9*     > 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 = 8
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/X8vcH
function name:  getPages
number of ops:  10
compiled vars:  !0 = $pages
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   FETCH_OBJ_R                                      ~1      'pages'
          1        ASSIGN                                                   !0, ~1
   42     2        FETCH_OBJ_R                                      ~3      'isBoss'
          3        IS_EQUAL                                                 ~3, 1
          4      > JMPZ                                                     ~4, ->8
   43     5    >   FETCH_OBJ_R                                      ~5      'pages'
          6        MUL                                              ~6      ~5, 0
          7        ASSIGN                                                   !0, ~6
   46     8    > > RETURN                                                   !0
   47     9*     > RETURN                                                   null

End of function getpages

End of class Marketer.

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

End of function __construct

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

End of function getsalary

Function getcoffee:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/X8vcH
function name:  getCoffee
number of ops:  10
compiled vars:  !0 = $coffee
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   FETCH_OBJ_R                                      ~1      'coffee'
          1        ASSIGN                                                   !0, ~1
   32     2        FETCH_OBJ_R                                      ~3      'isBoss'
          3        IS_EQUAL                                                 ~3, 1
          4      > JMPZ                                                     ~4, ->8
   33     5    >   FETCH_OBJ_R                                      ~5      'coffee'
          6        MUL                                              ~6      ~5, 2
          7        ASSIGN                                                   !0, ~6
   36     8    > > RETURN                                                   !0
   37     9*     > 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 = 8
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/X8vcH
function name:  getPages
number of ops:  10
compiled vars:  !0 = $pages
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   FETCH_OBJ_R                                      ~1      'pages'
          1        ASSIGN                                                   !0, ~1
   42     2        FETCH_OBJ_R                                      ~3      'isBoss'
          3        IS_EQUAL                                                 ~3, 1
          4      > JMPZ                                                     ~4, ->8
   43     5    >   FETCH_OBJ_R                                      ~5      'pages'
          6        MUL                                              ~6      ~5, 0
          7        ASSIGN                                                   !0, ~6
   46     8    > > RETURN                                                   !0
   47     9*     > RETURN                                                   null

End of function getpages

End of class Engineer.

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

End of function __construct

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

End of function getsalary

Function getcoffee:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/X8vcH
function name:  getCoffee
number of ops:  10
compiled vars:  !0 = $coffee
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   FETCH_OBJ_R                                      ~1      'coffee'
          1        ASSIGN                                                   !0, ~1
   32     2        FETCH_OBJ_R                                      ~3      'isBoss'
          3        IS_EQUAL                                                 ~3, 1
          4      > JMPZ                                                     ~4, ->8
   33     5    >   FETCH_OBJ_R                                      ~5      'coffee'
          6        MUL                                              ~6      ~5, 2
          7        ASSIGN                                                   !0, ~6
   36     8    > > RETURN                                                   !0
   37     9*     > 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 = 8
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/X8vcH
function name:  getPages
number of ops:  10
compiled vars:  !0 = $pages
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   FETCH_OBJ_R                                      ~1      'pages'
          1        ASSIGN                                                   !0, ~1
   42     2        FETCH_OBJ_R                                      ~3      'isBoss'
          3        IS_EQUAL                                                 ~3, 1
          4      > JMPZ                                                     ~4, ->8
   43     5    >   FETCH_OBJ_R                                      ~5      'pages'
          6        MUL                                              ~6      ~5, 0
          7        ASSIGN                                                   !0, ~6
   46     8    > > RETURN                                                   !0
   47     9*     > RETURN                                                   null

End of function getpages

End of class Analyst.

Class Department:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/X8vcH
function name:  __construct
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   78     0  E >

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
273.08 ms | 1428 KiB | 16 Q