3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); abstract class AbstractWorker{ public $rank; public $isBoss; public $count; public $coffeeConsumption; public $salary; public $printedPages; public function __construct($count, $rank, $isBoss) { $this->rank = $rank; $this->count = $count; $this->isBoss = $isBoss; } function CalculationOfInformation($rank, $isBoss){ if ($this->rank == 2){ $this->salary = $this->salary * 1.25 * $this->count; } elseif ($this->rank == 3){ $this->salary = $this->salary * 1.5 * $this->count; } else { $this->salary = $this->salary * $this->count; } $this->coffeeConsumption = $this->coffeeConsumption * $this->count; $this->printedPages = $this->printedPages * $this->count; if ($this->isBoss == 1){ $this->salary *= 1.5; $this->coffeeConsumption *= 2; $this->printedPages = 0; } } public function print($value){ return $value; } } class Manager extends AbstractWorker{ public $coffeeConsumption = 20; public $salary = 500; public $printedPages = 200; } class Marketer extends AbstractWorker{ public $coffeeConsumption = 15; public $salary = 400; public $printedPages = 150; } class Engineer extends AbstractWorker{ public $coffeeConsumption = 5; public $salary = 200; public $printedPages = 50; } class Analyst extends AbstractWorker{ public $coffeeConsumption = 50; public $salary = 800; public $printedPages = 5; } class Department { public $name; public $workers = array(); public function __construct($name) { $this->name = $name; } public function addWorkers(AbstractWorker $worker){ $worker->CalculationOfInformation($worker->rank, $worker->isBoss); $this->workers[] = $worker; } public function getInformation(){ $information = array( "name" => 0, "count" => 0, "coffee" => 0, "salary" => 0, "pages" => 0, "salaryDivedePagas" => 0 ); foreach ($this->workers as $worker) { $information["count"] += $worker->print($worker->count); $information["coffee"] += $worker->print($worker->coffeeConsumption); $information["salary"] += $worker->print($worker->salary); $information["pages"] += $worker->print($worker->printedPages); } $information["name"] = $this->name; $information["salaryDividePages"] = $information["salary"] / $information["pages"]; return $information; } } class Company { public $departments = array(); public $col = array(30, 8, 30, 8, 8, 15); public function addDepartment(Department $name){ $this->departments[] = $name; } public function padRight($string, $length){ echo $string; echo str_repeat(" ", $length - mb_strlen($string)); } public function printString(array $array, array $col){ echo $this->padRight($array[0], $this->col[0]) . $this->padRight($array[1], $this->col[1]) . $this->padRight($array[2], $this->col[2]). $this->padRight($array[3], $this->col[3]) . $this->padRight($array[4], $this->col[4]) . $this->padRight($array[5], $this->col[5]); echo "\n\n"; } public function printColumnName(){ $columnName = array("Департамент", "сотр.", "тург", "кофе", "cтр.", "тугр./стр."); // echo $this->padRight("Департамент", $this->col[0]) . // $this->padRight("сотр.", $this->col[1]) . // $this->padRight("тург.", $this->col[2]). // $this->padRight("кофе", $this->col[3]) . // $this->padRight("стр.", $this->col[4]) . // $this->padRight("тугр./стр.", $this->col[5]); // echo "\n\n"; printString($columnName, $this->col); } public function printDepartment(){ foreach ($this->departments as $department) { $information = $department->getInformation(); echo $this->padRight($information["name"], $this->col[0]). $this->padRight($information["count"], $this->col[1]). $this->padRight($information["coffee"], $this->col[2]). $this->padRight($information["salary"], $this->col[3]). $this->padRight($information["pages"], $this->col[4]). $this->padRight($information["salaryDividePages"], $this->col[5]); echo "\n"; } echo "\n"; } public function printTotalValue(){ $totalCoffee = 0; $totalWorkers = 0; $totalSalary = 0; $totalPages = 0; $totalSalaryDivedePages = 0; $totalValue = array(); foreach ($this->departments as $department) { $totalValues = $department->getInformation(); $totalCoffee += $totalValues["coffee"]; $totalWorkers += $totalValues["count"]; $totalSalary += $totalValues["salary"]; $totalPages += $totalValues["pages"]; $totalSalaryDivedePages += $totalValues["salaryDividePages"]; } echo $this->padRight("Всего", $this->col[0]). $this->padRight($totalWorkers, $this->col[1]). $this->padRight($totalSalary, $this->col[2]). $this->padRight($totalCoffee, $this->col[3]). $this->padRight($totalPages, $this->col[4]). $this->padRight($totalSalaryDivedePages, $this->col[5]); echo "\n"; } public function printAverageValue(){ $averageCoffee = 0; $averageWorkers = 0; $averageSalary = 0; $averagePages = 0; $averageSalaryDivedePages = 0; $averageValue = array(); foreach ($this->departments as $department) { $averageValues = $department->getInformation(); $averageCoffee += $averageValues["coffee"]; $averageWorkers += $averageValues["count"]; $averageSalary += $averageValues["salary"]; $averagePages += $averageValues["pages"]; $averageSalaryDivedePages += $averageValues["salaryDividePages"]; } $averageCoffee /= count($this->departments); $averageSalary /= count($this->departments); $averageWorkers /= count($this->departments); $averagePages /= count($this->departments); $averageSalaryDivedePages /= count($this->departments); echo $this->padRight("Среднее", $this->col[0]). $this->padRight($averageWorkers, $this->col[1]). $this->padRight($averageSalary, $this->col[2]). $this->padRight($averageCoffee, $this->col[3]). $this->padRight($averagePages, $this->col[4]). $this->padRight($averageSalaryDivedePages, $this->col[5]); } } $vektor = new Company; $procurementDepartment = new Department("Закупок"); $procurementDepartment->addWorkers(new Manager(9, 1, 0)); $procurementDepartment->addWorkers(new Manager(3, 2, 0)); $procurementDepartment->addWorkers(new Manager(2, 3, 0)); $procurementDepartment->addWorkers(new Marketer(2, 1, 0)); $procurementDepartment->addWorkers(new Manager(1, 2, 1)); $sellingDepartment = new Department("Продаж"); $sellingDepartment->addWorkers(new Manager(12, 1, 0)); $sellingDepartment->addWorkers(new Marketer(6, 1, 0)); $sellingDepartment->addWorkers(new Analyst(3, 1, 0)); $sellingDepartment->addWorkers(new Analyst(2, 2, 0)); $sellingDepartment->addWorkers(new Marketer(1, 2, 1)); $advertisingDepartment = new Department("Рекламы"); $advertisingDepartment->addWorkers(new Marketer(15, 1, 0)); $advertisingDepartment->addWorkers(new Marketer(10, 2, 0)); $advertisingDepartment->addWorkers(new Manager(8, 1, 0)); $advertisingDepartment->addWorkers(new Engineer(2, 1, 0)); $advertisingDepartment->addWorkers(new Marketer(1, 3, 1)); $logisticsDepartment = new Department("Логистики"); $logisticsDepartment->addWorkers(new Manager(13, 1, 0)); $logisticsDepartment->addWorkers(new Manager(5, 2, 0)); $logisticsDepartment->addWorkers(new Engineer(5, 1, 0)); $logisticsDepartment->addWorkers(new Manager(1, 1, 1)); $vektor->addDepartment($procurementDepartment); $vektor->addDepartment($sellingDepartment); $vektor->addDepartment($advertisingDepartment); $vektor->addDepartment($logisticsDepartment); $vektor->printColumnName(); $vektor->printDepartment(); $vektor->printTotalValue(); $vektor->printAverageValue();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/caam4
function name:  (null)
number of ops:  195
compiled vars:  !0 = $vektor, !1 = $procurementDepartment, !2 = $sellingDepartment, !3 = $advertisingDepartment, !4 = $logisticsDepartment
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 -1
          2        DO_ICALL                                                 
  226     3        NEW                                              $6      'Company'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $6
  228     6        NEW                                              $9      'Department'
          7        SEND_VAL_EX                                              '%D0%97%D0%B0%D0%BA%D1%83%D0%BF%D0%BE%D0%BA'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $9
  229    10        INIT_METHOD_CALL                                         !1, 'addWorkers'
         11        NEW                                              $12     'Manager'
         12        SEND_VAL_EX                                              9
         13        SEND_VAL_EX                                              1
         14        SEND_VAL_EX                                              0
         15        DO_FCALL                                      0          
         16        SEND_VAR_NO_REF_EX                                       $12
         17        DO_FCALL                                      0          
  230    18        INIT_METHOD_CALL                                         !1, 'addWorkers'
         19        NEW                                              $15     'Manager'
         20        SEND_VAL_EX                                              3
         21        SEND_VAL_EX                                              2
         22        SEND_VAL_EX                                              0
         23        DO_FCALL                                      0          
         24        SEND_VAR_NO_REF_EX                                       $15
         25        DO_FCALL                                      0          
  231    26        INIT_METHOD_CALL                                         !1, 'addWorkers'
         27        NEW                                              $18     'Manager'
         28        SEND_VAL_EX                                              2
         29        SEND_VAL_EX                                              3
         30        SEND_VAL_EX                                              0
         31        DO_FCALL                                      0          
         32        SEND_VAR_NO_REF_EX                                       $18
         33        DO_FCALL                                      0          
  232    34        INIT_METHOD_CALL                                         !1, 'addWorkers'
         35        NEW                                              $21     'Marketer'
         36        SEND_VAL_EX                                              2
         37        SEND_VAL_EX                                              1
         38        SEND_VAL_EX                                              0
         39        DO_FCALL                                      0          
         40        SEND_VAR_NO_REF_EX                                       $21
         41        DO_FCALL                                      0          
  233    42        INIT_METHOD_CALL                                         !1, 'addWorkers'
         43        NEW                                              $24     'Manager'
         44        SEND_VAL_EX                                              1
         45        SEND_VAL_EX                                              2
         46        SEND_VAL_EX                                              1
         47        DO_FCALL                                      0          
         48        SEND_VAR_NO_REF_EX                                       $24
         49        DO_FCALL                                      0          
  235    50        NEW                                              $27     'Department'
         51        SEND_VAL_EX                                              '%D0%9F%D1%80%D0%BE%D0%B4%D0%B0%D0%B6'
         52        DO_FCALL                                      0          
         53        ASSIGN                                                   !2, $27
  236    54        INIT_METHOD_CALL                                         !2, 'addWorkers'
         55        NEW                                              $30     'Manager'
         56        SEND_VAL_EX                                              12
         57        SEND_VAL_EX                                              1
         58        SEND_VAL_EX                                              0
         59        DO_FCALL                                      0          
         60        SEND_VAR_NO_REF_EX                                       $30
         61        DO_FCALL                                      0          
  237    62        INIT_METHOD_CALL                                         !2, 'addWorkers'
         63        NEW                                              $33     'Marketer'
         64        SEND_VAL_EX                                              6
         65        SEND_VAL_EX                                              1
         66        SEND_VAL_EX                                              0
         67        DO_FCALL                                      0          
         68        SEND_VAR_NO_REF_EX                                       $33
         69        DO_FCALL                                      0          
  238    70        INIT_METHOD_CALL                                         !2, 'addWorkers'
         71        NEW                                              $36     'Analyst'
         72        SEND_VAL_EX                                              3
         73        SEND_VAL_EX                                              1
         74        SEND_VAL_EX                                              0
         75        DO_FCALL                                      0          
         76        SEND_VAR_NO_REF_EX                                       $36
         77        DO_FCALL                                      0          
  239    78        INIT_METHOD_CALL                                         !2, 'addWorkers'
         79        NEW                                              $39     'Analyst'
         80        SEND_VAL_EX                                              2
         81        SEND_VAL_EX                                              2
         82        SEND_VAL_EX                                              0
         83        DO_FCALL                                      0          
         84        SEND_VAR_NO_REF_EX                                       $39
         85        DO_FCALL                                      0          
  240    86        INIT_METHOD_CALL                                         !2, 'addWorkers'
         87        NEW                                              $42     'Marketer'
         88        SEND_VAL_EX                                              1
         89        SEND_VAL_EX                                              2
         90        SEND_VAL_EX                                              1
         91        DO_FCALL                                      0          
         92        SEND_VAR_NO_REF_EX                                       $42
         93        DO_FCALL                                      0          
  242    94        NEW                                              $45     'Department'
         95        SEND_VAL_EX                                              '%D0%A0%D0%B5%D0%BA%D0%BB%D0%B0%D0%BC%D1%8B'
         96        DO_FCALL                                      0          
         97        ASSIGN                                                   !3, $45
  243    98        INIT_METHOD_CALL                                         !3, 'addWorkers'
         99        NEW                                              $48     'Marketer'
        100        SEND_VAL_EX                                              15
        101        SEND_VAL_EX                                              1
        102        SEND_VAL_EX                                              0
        103        DO_FCALL                                      0          
        104        SEND_VAR_NO_REF_EX                                       $48
        105        DO_FCALL                                      0          
  244   106        INIT_METHOD_CALL                                         !3, 'addWorkers'
        107        NEW                                              $51     'Marketer'
        108        SEND_VAL_EX                                              10
        109        SEND_VAL_EX                                              2
        110        SEND_VAL_EX                                              0
        111        DO_FCALL                                      0          
        112        SEND_VAR_NO_REF_EX                                       $51
        113        DO_FCALL                                      0          
  245   114        INIT_METHOD_CALL                                         !3, 'addWorkers'
        115        NEW                                              $54     'Manager'
        116        SEND_VAL_EX                                              8
        117        SEND_VAL_EX                                              1
        118        SEND_VAL_EX                                              0
        119        DO_FCALL                                      0          
        120        SEND_VAR_NO_REF_EX                                       $54
        121        DO_FCALL                                      0          
  246   122        INIT_METHOD_CALL                                         !3, 'addWorkers'
        123        NEW                                              $57     'Engineer'
        124        SEND_VAL_EX                                              2
        125        SEND_VAL_EX                                              1
        126        SEND_VAL_EX                                              0
        127        DO_FCALL                                      0          
        128        SEND_VAR_NO_REF_EX                                       $57
        129        DO_FCALL                                      0          
  247   130        INIT_METHOD_CALL                                         !3, 'addWorkers'
        131        NEW                                              $60     'Marketer'
        132        SEND_VAL_EX                                              1
        133        SEND_VAL_EX                                              3
        134        SEND_VAL_EX                                              1
        135        DO_FCALL                                      0          
        136        SEND_VAR_NO_REF_EX                                       $60
        137        DO_FCALL                                      0          
  249   138        NEW                                              $63     'Department'
        139        SEND_VAL_EX                                              '%D0%9B%D0%BE%D0%B3%D0%B8%D1%81%D1%82%D0%B8%D0%BA%D0%B8'
        140        DO_FCALL                                      0          
        141        ASSIGN                                                   !4, $63
  250   142        INIT_METHOD_CALL                                         !4, 'addWorkers'
        143        NEW                                              $66     'Manager'
        144        SEND_VAL_EX                                              13
        145        SEND_VAL_EX                                              1
        146        SEND_VAL_EX                                              0
        147        DO_FCALL                                      0          
        148        SEND_VAR_NO_REF_EX                                       $66
        149        DO_FCALL                                      0          
  251   150        INIT_METHOD_CALL                                         !4, 'addWorkers'
        151        NEW                                              $69     'Manager'
        152        SEND_VAL_EX                                              5
        153        SEND_VAL_EX                                              2
        154        SEND_VAL_EX                                              0
        155        DO_FCALL                                      0          
        156        SEND_VAR_NO_REF_EX                                       $69
        157        DO_FCALL                                      0          
  252   158        INIT_METHOD_CALL                                         !4, 'addWorkers'
        159        NEW                                              $72     'Engineer'
        160        SEND_VAL_EX                                              5
        161        SEND_VAL_EX                                              1
        162        SEND_VAL_EX                                              0
        163        DO_FCALL                                      0          
        164        SEND_VAR_NO_REF_EX                                       $72
        165        DO_FCALL                                      0          
  253   166        INIT_METHOD_CALL                                         !4, 'addWorkers'
        167        NEW                                              $75     'Manager'
        168        SEND_VAL_EX                                              1
        169        SEND_VAL_EX                                              1
        170        SEND_VAL_EX                                              1
        171        DO_FCALL                                      0          
        172        SEND_VAR_NO_REF_EX                                       $75
        173        DO_FCALL                                      0          
  255   174        INIT_METHOD_CALL                                         !0, 'addDepartment'
        175        SEND_VAR_EX                                              !1
        176        DO_FCALL                                      0          
  256   177        INIT_METHOD_CALL                                         !0, 'addDepartment'
        178        SEND_VAR_EX                                              !2
        179        DO_FCALL                                      0          
  257   180        INIT_METHOD_CALL                                         !0, 'addDepartment'
        181        SEND_VAR_EX                                              !3
        182        DO_FCALL                                      0          
  258   183        INIT_METHOD_CALL                                         !0, 'addDepartment'
        184        SEND_VAR_EX                                              !4
        185        DO_FCALL                                      0          
  260   186        INIT_METHOD_CALL                                         !0, 'printColumnName'
        187        DO_FCALL                                      0          
  261   188        INIT_METHOD_CALL                                         !0, 'printDepartment'
        189        DO_FCALL                                      0          
  262   190        INIT_METHOD_CALL                                         !0, 'printTotalValue'
        191        DO_FCALL                                      0          
  263   192        INIT_METHOD_CALL                                         !0, 'printAverageValue'
        193        DO_FCALL                                      0          
        194      > RETURN                                                   1

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

End of function __construct

Function calculationofinformation:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 46
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 46
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 46
Branch analysis from position: 40
Branch analysis from position: 46
filename:       /in/caam4
function name:  CalculationOfInformation
number of ops:  47
compiled vars:  !0 = $rank, !1 = $isBoss
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   20     2        FETCH_OBJ_R                                      ~2      'rank'
          3        IS_EQUAL                                                 ~2, 2
          4      > JMPZ                                                     ~3, ->12
   21     5    >   FETCH_OBJ_R                                      ~5      'salary'
          6        MUL                                              ~6      ~5, 1.25
          7        FETCH_OBJ_R                                      ~7      'count'
          8        MUL                                              ~8      ~6, ~7
          9        ASSIGN_OBJ                                               'salary'
         10        OP_DATA                                                  ~8
         11      > JMP                                                      ->27
   22    12    >   FETCH_OBJ_R                                      ~9      'rank'
         13        IS_EQUAL                                                 ~9, 3
         14      > JMPZ                                                     ~10, ->22
   23    15    >   FETCH_OBJ_R                                      ~12     'salary'
         16        MUL                                              ~13     ~12, 1.5
         17        FETCH_OBJ_R                                      ~14     'count'
         18        MUL                                              ~15     ~13, ~14
         19        ASSIGN_OBJ                                               'salary'
         20        OP_DATA                                                  ~15
         21      > JMP                                                      ->27
   25    22    >   FETCH_OBJ_R                                      ~17     'salary'
         23        FETCH_OBJ_R                                      ~18     'count'
         24        MUL                                              ~19     ~17, ~18
         25        ASSIGN_OBJ                                               'salary'
         26        OP_DATA                                                  ~19
   28    27    >   FETCH_OBJ_R                                      ~21     'coffeeConsumption'
         28        FETCH_OBJ_R                                      ~22     'count'
         29        MUL                                              ~23     ~21, ~22
         30        ASSIGN_OBJ                                               'coffeeConsumption'
         31        OP_DATA                                                  ~23
   29    32        FETCH_OBJ_R                                      ~25     'printedPages'
         33        FETCH_OBJ_R                                      ~26     'count'
         34        MUL                                              ~27     ~25, ~26
         35        ASSIGN_OBJ                                               'printedPages'
         36        OP_DATA                                                  ~27
   31    37        FETCH_OBJ_R                                      ~28     'isBoss'
         38        IS_EQUAL                                                 ~28, 1
         39      > JMPZ                                                     ~29, ->46
   32    40    >   ASSIGN_OBJ_OP                                 3          'salary'
         41        OP_DATA                                                  1.5
   33    42        ASSIGN_OBJ_OP                                 3          'coffeeConsumption'
         43        OP_DATA                                                  2
   34    44        ASSIGN_OBJ                                               'printedPages'
         45        OP_DATA                                                  0
   36    46    > > RETURN                                                   null

End of function calculationofinformation

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

End of function print

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/caam4
function name:  __construct
number of ops:  10
compiled vars:  !0 = $count, !1 = $rank, !2 = $isBoss
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   14     3        ASSIGN_OBJ                                               'rank'
          4        OP_DATA                                                  !1
   15     5        ASSIGN_OBJ                                               'count'
          6        OP_DATA                                                  !0
   16     7        ASSIGN_OBJ                                               'isBoss'
          8        OP_DATA                                                  !2
   17     9      > RETURN                                                   null

End of function __construct

Function calculationofinformation:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 46
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 46
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 46
Branch analysis from position: 40
Branch analysis from position: 46
filename:       /in/caam4
function name:  CalculationOfInformation
number of ops:  47
compiled vars:  !0 = $rank, !1 = $isBoss
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   20     2        FETCH_OBJ_R                                      ~2      'rank'
          3        IS_EQUAL                                                 ~2, 2
          4      > JMPZ                                                     ~3, ->12
   21     5    >   FETCH_OBJ_R                                      ~5      'salary'
          6        MUL                                              ~6      ~5, 1.25
          7        FETCH_OBJ_R                                      ~7      'count'
          8        MUL                                              ~8      ~6, ~7
          9        ASSIGN_OBJ                                               'salary'
         10        OP_DATA                                                  ~8
         11      > JMP                                                      ->27
   22    12    >   FETCH_OBJ_R                                      ~9      'rank'
         13        IS_EQUAL                                                 ~9, 3
         14      > JMPZ                                                     ~10, ->22
   23    15    >   FETCH_OBJ_R                                      ~12     'salary'
         16        MUL                                              ~13     ~12, 1.5
         17        FETCH_OBJ_R                                      ~14     'count'
         18        MUL                                              ~15     ~13, ~14
         19        ASSIGN_OBJ                                               'salary'
         20        OP_DATA                                                  ~15
         21      > JMP                                                      ->27
   25    22    >   FETCH_OBJ_R                                      ~17     'salary'
         23        FETCH_OBJ_R                                      ~18     'count'
         24        MUL                                              ~19     ~17, ~18
         25        ASSIGN_OBJ                                               'salary'
         26        OP_DATA                                                  ~19
   28    27    >   FETCH_OBJ_R                                      ~21     'coffeeConsumption'
         28        FETCH_OBJ_R                                      ~22     'count'
         29        MUL                                              ~23     ~21, ~22
         30        ASSIGN_OBJ                                               'coffeeConsumption'
         31        OP_DATA                                                  ~23
   29    32        FETCH_OBJ_R                                      ~25     'printedPages'
         33        FETCH_OBJ_R                                      ~26     'count'
         34        MUL                                              ~27     ~25, ~26
         35        ASSIGN_OBJ                                               'printedPages'
         36        OP_DATA                                                  ~27
   31    37        FETCH_OBJ_R                                      ~28     'isBoss'
         38        IS_EQUAL                                                 ~28, 1
         39      > JMPZ                                                     ~29, ->46
   32    40    >   ASSIGN_OBJ_OP                                 3          'salary'
         41        OP_DATA                                                  1.5
   33    42        ASSIGN_OBJ_OP                                 3          'coffeeConsumption'
         43        OP_DATA                                                  2
   34    44        ASSIGN_OBJ                                               'printedPages'
         45        OP_DATA                                                  0
   36    46    > > RETURN                                                   null

End of function calculationofinformation

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

End of function print

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/caam4
function name:  __construct
number of ops:  10
compiled vars:  !0 = $count, !1 = $rank, !2 = $isBoss
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   14     3        ASSIGN_OBJ                                               'rank'
          4        OP_DATA                                                  !1
   15     5        ASSIGN_OBJ                                               'count'
          6        OP_DATA                                                  !0
   16     7        ASSIGN_OBJ                                               'isBoss'
          8        OP_DATA                                                  !2
   17     9      > RETURN                                                   null

End of function __construct

Function calculationofinformation:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 46
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 46
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 46
Branch analysis from position: 40
Branch analysis from position: 46
filename:       /in/caam4
function name:  CalculationOfInformation
number of ops:  47
compiled vars:  !0 = $rank, !1 = $isBoss
line      #*

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
387.47 ms | 1420 KiB | 17 Q