3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php error_reporting(-1); abstract class AbstractWorker{ private $rank; private $isBoss; private $coffee; private $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() / 2, 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);
based on ZYG6d
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/2DF0W
function name:  (null)
number of ops:  38
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                                                 
   5     3        NOP                                                      
  50     4        NOP                                                      
         5        NOP                                                      
  56     6        NOP                                                      
         7        NOP                                                      
  62     8        NOP                                                      
         9        NOP                                                      
  68    10        NOP                                                      
        11        NOP                                                      
  74    12        NOP                                                      
 153    13        NOP                                                      
 169    14        NOP                                                      
 252    15        NEW                                              $16     :5
        16        DO_FCALL                                      0          
        17        ASSIGN                                                   !0, $16
 254    18        NEW                                              $19     :7
        19        SEND_VAL_EX                                              '%D0%97%D0%B0%D0%BF%D1%83%D0%BA%D0%B8'
        20        DO_FCALL                                      0          
        21        ASSIGN                                                   !1, $19
 255    22        INIT_METHOD_CALL                                         !1, 'addWorkersToDepartment'
        23        SEND_VAL_EX                                              'Manager'
        24        SEND_VAL_EX                                              5
        25        SEND_VAL_EX                                              2
        26        SEND_VAL_EX                                              0
        27        DO_FCALL                                      0          
 257    28        INIT_METHOD_CALL                                         !0, 'addDepartment'
        29        SEND_VAR_EX                                              !1
        30        DO_FCALL                                      0          
 259    31        NEW                                              $24     :18
        32        DO_FCALL                                      0          
        33        ASSIGN                                                   !2, $24
 261    34        INIT_METHOD_CALL                                         !2, 'printTabel'
        35        SEND_VAR_EX                                              !0
        36        DO_FCALL                                      0          
        37      > RETURN                                                   1

Class AbstractWorker:
Function __construct:
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/2DF0W
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
Jump found. (Code = 43) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
Jump found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
Jump found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/2DF0W
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                                         ~4      $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                                         ~9      $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
Jump found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/2DF0W
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                                         ~4      $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
Jump found. (Code = 62) Position 1 = -2
filename:       /in/2DF0W
function name:  getPages
number of ops:  4
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
  46     2      > RETURN                                                   !0
  47     3*     > RETURN                                                   null

End of function getpages

End of class AbstractWorker.

Class Manager:
Function __construct:
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/2DF0W
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
Jump found. (Code = 43) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
Jump found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
Jump found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/2DF0W
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                                         ~4      $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                                         ~9      $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
Jump found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/2DF0W
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                                         ~4      $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
Jump found. (Code = 62) Position 1 = -2
filename:       /in/2DF0W
function name:  getPages
number of ops:  4
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
  46     2      > RETURN                                                   !0
  47     3*     > RETURN                                                   null

End of function getpages

End of class Manager.

Class Marketer:
Function __construct:
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/2DF0W
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
Jump found. (Code = 43) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
Jump found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
Jump found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/2DF0W
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                                         ~4      $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                                         ~9      $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
Jump found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/2DF0W
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                                         ~4      $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
Jump found. (Code = 62) Position 1 = -2
filename:       /in/2DF0W
function name:  getPages
number of ops:  4
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
  46     2      > RETURN                                                   !0
  47     3*     > RETURN                                                   null

End of function getpages

End of class Marketer.

Class Engineer:
Function __construct:
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/2DF0W
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
Jump found. (Code = 43) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
Jump found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
Jump found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/2DF0W
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                                         ~4      $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                                         ~9      $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
Jump found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/2DF0W
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                                         ~4      $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
Jump found. (Code = 62) Position 1 = -2
filename:       /in/2DF0W
function name:  getPages
number of ops:  4
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
  46     2      > RETURN                                                   !0
  47     3*     > RETURN                                                   null

End of function getpages

End of class Engineer.

Class Analyst:
Function __construct:
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/2DF0W
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
Jump found. (Code = 43) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
Jump found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
Jump found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/2DF0W
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                                         ~4      $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                                         ~9      $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
Jump found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/2DF0W
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                                         ~4      $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
Jump found. (Code = 62) Position 1 = -2
filename:       /in/2DF0W
function name:  getPages
number of ops:  4
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
  46     2      > RETURN                                                   !0
  47     3*     > RETURN                                                   null

End of function getpages

End of class Analyst.

Class Department:
Function __construct:
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/2DF0W
function name:  __construct
number of ops:  4
compiled vars:  !0 = $name
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  78     0  E >   RECV                                             !0      
  79     1        ASSIGN_OBJ                                               'name'
         2        OP_DATA                                                  !0
  80     3      > RETURN                                                   null

End of function __construct

Function addworker:
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/2DF0W
function name:  addWorker
number of ops:  5
compiled vars:  !0 = $worker
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  82     0  E >   RECV                                             !0      
  84     1        FETCH_OBJ_W                                      $1      'workers'
         2        ASSIGN_DIM                                               $1
         3        OP_DATA                                                  !0
  85     4      > RETURN                                                   null

End of function addworker

Function getnumberworkers:
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/2DF0W
function name:  getNumberWorkers
number of ops:  6
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  88     0  E >   INIT_FCALL                                               'count'
         1        FETCH_OBJ_R                                      $0      'workers'
         2        SEND_VAR                                                 $0
         3        DO_ICALL                                         $1      
         4      > RETURN                                                   $1
  89     5*     > RETURN                                                   null

End of function getnumberworkers

Function getdepartmentsalary:
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 77) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
Jump found. (Code = 78) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
Jump found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 8
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/2DF0W
function name:  getDepartmentSalary
number of ops:  11
compiled vars:  !0 = $totalSalary, !1 = $worker
line     #* E 

Generated using Vulcan Logic Dumper, using php 7.2.0