3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Employee { public $baseSalary; public $rank; public $pages; public $isBoss; public $coffee; function __construct($rank, $isBoss) { $this->rank = $rank; $this->isBoss = $isBoss; $this->calculateSalary(); } private function calculateSalary() { $coef = 1; switch ($this->rank) { case 2: $coef *= 1.25; break; case 3: $coef *= 1.50; break; } $coef = ($this->isBoss ? $coef *= 1.50 : $coef); $this->salary = $this->baseSalary*$coef; } } class Manager extends Employee { public $rank = 1; public $baseSalary = 500; public $coffee = 20; public $pages = 200; public $boss = false; public $salary = 0; } class Marketer extends Employee { public $rank = 1; public $baseSalary = 400; public $coffee = 15; public $pages = 150; public $boss = false; public $salary = 0; } class Analyst extends Employee { public $rank = 1; public $baseSalary = 800; public $coffee = 50; public $pages = 5; public $boss = false; public $salary = 0; } class Engineer extends Employee { public $rank = 1; public $baseSalary = 200; public $coffee = 5; public $pages = 50; public $boss = false; public $salary = 0; } class Department { public $name; public $employees = []; function __construct($name) { $this->name = $name; } function addEmployees($position, $amountEmloyees, $rank = 1, $isBoss = false) { for ($i=0; $i < $amountEmloyees; $i++) { $this->employees[] = new $position($rank, $isBoss); } } function totalByDepartment() { $arr = ['coffeeByDept' => 0, 'pagesByDept' => 0, 'salaryByDept' => 0]; foreach ($this->employees as $key => $value) { $arr['coffeeByDept'] += $value->coffee; $arr['pagesByDept'] += $value->pages; $arr['salaryByDept'] += $value->salary; } $arr['amountEmloyees'] = count($this->employees); $arr['salaryByPage'] = round($arr['salaryByDept'] / $arr['pagesByDept'], 2); return $arr; } } $DepartmentProcurement = new Department('Procurement'); $DepartmentProcurement->addEmployees('Manager', 9); $DepartmentProcurement->addEmployees('Manager', 3, 2); $DepartmentProcurement->addEmployees('Manager', 2, 3); $DepartmentProcurement->addEmployees('Marketer', 2); $DepartmentProcurement->addEmployees('Manager', 1, 2, true); $DepartmentSales = new Department('Sales'); $DepartmentSales->addEmployees('Manager', 12); $DepartmentSales->addEmployees('Marketer', 6); $DepartmentSales->addEmployees('Analyst', 3); $DepartmentSales->addEmployees('Analyst', 2, 2); $DepartmentSales->addEmployees('Marketer', 1, 2, true); $totalBySalesDept = $DepartmentSales->totalByDepartment(); $totalByProcurementDept = $DepartmentProcurement->totalByDepartment(); var_dump($totalByProcurementDept); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rbolh
function name:  (null)
number of ops:  65
compiled vars:  !0 = $DepartmentProcurement, !1 = $DepartmentSales, !2 = $totalBySalesDept, !3 = $totalByProcurementDept
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  105     0  E >   NEW                                              $4      'Department'
          1        SEND_VAL_EX                                              'Procurement'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
  107     4        INIT_METHOD_CALL                                         !0, 'addEmployees'
          5        SEND_VAL_EX                                              'Manager'
          6        SEND_VAL_EX                                              9
          7        DO_FCALL                                      0          
  108     8        INIT_METHOD_CALL                                         !0, 'addEmployees'
          9        SEND_VAL_EX                                              'Manager'
         10        SEND_VAL_EX                                              3
         11        SEND_VAL_EX                                              2
         12        DO_FCALL                                      0          
  109    13        INIT_METHOD_CALL                                         !0, 'addEmployees'
         14        SEND_VAL_EX                                              'Manager'
         15        SEND_VAL_EX                                              2
         16        SEND_VAL_EX                                              3
         17        DO_FCALL                                      0          
  110    18        INIT_METHOD_CALL                                         !0, 'addEmployees'
         19        SEND_VAL_EX                                              'Marketer'
         20        SEND_VAL_EX                                              2
         21        DO_FCALL                                      0          
  111    22        INIT_METHOD_CALL                                         !0, 'addEmployees'
         23        SEND_VAL_EX                                              'Manager'
         24        SEND_VAL_EX                                              1
         25        SEND_VAL_EX                                              2
         26        SEND_VAL_EX                                              <true>
         27        DO_FCALL                                      0          
  113    28        NEW                                              $12     'Department'
         29        SEND_VAL_EX                                              'Sales'
         30        DO_FCALL                                      0          
         31        ASSIGN                                                   !1, $12
  115    32        INIT_METHOD_CALL                                         !1, 'addEmployees'
         33        SEND_VAL_EX                                              'Manager'
         34        SEND_VAL_EX                                              12
         35        DO_FCALL                                      0          
  116    36        INIT_METHOD_CALL                                         !1, 'addEmployees'
         37        SEND_VAL_EX                                              'Marketer'
         38        SEND_VAL_EX                                              6
         39        DO_FCALL                                      0          
  117    40        INIT_METHOD_CALL                                         !1, 'addEmployees'
         41        SEND_VAL_EX                                              'Analyst'
         42        SEND_VAL_EX                                              3
         43        DO_FCALL                                      0          
  118    44        INIT_METHOD_CALL                                         !1, 'addEmployees'
         45        SEND_VAL_EX                                              'Analyst'
         46        SEND_VAL_EX                                              2
         47        SEND_VAL_EX                                              2
         48        DO_FCALL                                      0          
  119    49        INIT_METHOD_CALL                                         !1, 'addEmployees'
         50        SEND_VAL_EX                                              'Marketer'
         51        SEND_VAL_EX                                              1
         52        SEND_VAL_EX                                              2
         53        SEND_VAL_EX                                              <true>
         54        DO_FCALL                                      0          
  122    55        INIT_METHOD_CALL                                         !1, 'totalByDepartment'
         56        DO_FCALL                                      0  $20     
         57        ASSIGN                                                   !2, $20
  123    58        INIT_METHOD_CALL                                         !0, 'totalByDepartment'
         59        DO_FCALL                                      0  $22     
         60        ASSIGN                                                   !3, $22
  124    61        INIT_FCALL                                               'var_dump'
         62        SEND_VAR                                                 !3
         63        DO_ICALL                                                 
  125    64      > RETURN                                                   1

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

End of function __construct

Function calculatesalary:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
filename:       /in/rbolh
function name:  calculateSalary
number of ops:  24
compiled vars:  !0 = $coef
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ASSIGN                                                   !0, 1
   19     1        FETCH_OBJ_R                                      ~2      'rank'
   20     2        CASE                                                     ~2, 2
          3      > JMPNZ                                                    ~3, ->7
   23     4    >   CASE                                                     ~2, 3
          5      > JMPNZ                                                    ~3, ->9
          6    > > JMP                                                      ->11
   21     7    >   ASSIGN_OP                                     3          !0, 1.25
   22     8      > JMP                                                      ->11
   24     9    >   ASSIGN_OP                                     3          !0, 1.5
   25    10      > JMP                                                      ->11
         11    >   FREE                                                     ~2
   27    12        FETCH_OBJ_R                                      ~6      'isBoss'
         13      > JMPZ                                                     ~6, ->17
         14    >   ASSIGN_OP                                     3  ~7      !0, 1.5
         15        QM_ASSIGN                                        ~8      ~7
         16      > JMP                                                      ->18
         17    >   QM_ASSIGN                                        ~8      !0
         18    >   ASSIGN                                                   !0, ~8
   28    19        FETCH_OBJ_R                                      ~11     'baseSalary'
         20        MUL                                              ~12     !0, ~11
         21        ASSIGN_OBJ                                               'salary'
         22        OP_DATA                                                  ~12
   29    23      > RETURN                                                   null

End of function calculatesalary

End of class Employee.

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

End of function __construct

Function calculatesalary:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
filename:       /in/rbolh
function name:  calculateSalary
number of ops:  24
compiled vars:  !0 = $coef
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ASSIGN                                                   !0, 1
   19     1        FETCH_OBJ_R                                      ~2      'rank'
   20     2        CASE                                                     ~2, 2
          3      > JMPNZ                                                    ~3, ->7
   23     4    >   CASE                                                     ~2, 3
          5      > JMPNZ                                                    ~3, ->9
          6    > > JMP                                                      ->11
   21     7    >   ASSIGN_OP                                     3          !0, 1.25
   22     8      > JMP                                                      ->11
   24     9    >   ASSIGN_OP                                     3          !0, 1.5
   25    10      > JMP                                                      ->11
         11    >   FREE                                                     ~2
   27    12        FETCH_OBJ_R                                      ~6      'isBoss'
         13      > JMPZ                                                     ~6, ->17
         14    >   ASSIGN_OP                                     3  ~7      !0, 1.5
         15        QM_ASSIGN                                        ~8      ~7
         16      > JMP                                                      ->18
         17    >   QM_ASSIGN                                        ~8      !0
         18    >   ASSIGN                                                   !0, ~8
   28    19        FETCH_OBJ_R                                      ~11     'baseSalary'
         20        MUL                                              ~12     !0, ~11
         21        ASSIGN_OBJ                                               'salary'
         22        OP_DATA                                                  ~12
   29    23      > RETURN                                                   null

End of function calculatesalary

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

End of function __construct

Function calculatesalary:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
filename:       /in/rbolh
function name:  calculateSalary
number of ops:  24
compiled vars:  !0 = $coef
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ASSIGN                                                   !0, 1
   19     1        FETCH_OBJ_R                                      ~2      'rank'
   20     2        CASE                                                     ~2, 2
          3      > JMPNZ                                                    ~3, ->7
   23     4    >   CASE                                                     ~2, 3
          5      > JMPNZ                                                    ~3, ->9
          6    > > JMP                                                      ->11
   21     7    >   ASSIGN_OP                                     3          !0, 1.25
   22     8      > JMP                                                      ->11
   24     9    >   ASSIGN_OP                                     3          !0, 1.5
   25    10      > JMP                                                      ->11
         11    >   FREE                                                     ~2
   27    12        FETCH_OBJ_R                                      ~6      'isBoss'
         13      > JMPZ                                                     ~6, ->17
         14    >   ASSIGN_OP                                     3  ~7      !0, 1.5
         15        QM_ASSIGN                                        ~8      ~7
         16      > JMP                                                      ->18
         17    >   QM_ASSIGN                                        ~8      !0
         18    >   ASSIGN                                                   !0, ~8
   28    19        FETCH_OBJ_R                                      ~11     'baseSalary'
         20        MUL                                              ~12     !0, ~11
         21        ASSIGN_OBJ                                               'salary'
         22        OP_DATA                                                  ~12
   29    23      > RETURN                                                   null

End of function calculatesalary

End of class Marketer.

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

End of function __construct

Function calculatesalary:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
filename:       /in/rbolh
function name:  calculateSalary
number of ops:  24
compiled vars:  !0 = $coef
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ASSIGN                                                   !0, 1
   19     1        FETCH_OBJ_R                                      ~2      'rank'
   20     2        CASE                                                     ~2, 2
          3      > JMPNZ                                                    ~3, ->7
   23     4    >   CASE                                                     ~2, 3
          5      > JMPNZ                                                    ~3, ->9
          6    > > JMP                                                      ->11
   21     7    >   ASSIGN_OP                                     3          !0, 1.25
   22     8      > JMP                                                      ->11
   24     9    >   ASSIGN_OP                                     3          !0, 1.5
   25    10      > JMP                                                      ->11
         11    >   FREE                                                     ~2
   27    12        FETCH_OBJ_R                                      ~6      'isBoss'
         13      > JMPZ                                                     ~6, ->17
         14    >   ASSIGN_OP                                     3  ~7      !0, 1.5
         15        QM_ASSIGN                                        ~8      ~7
         16      > JMP                                                      ->18
         17    >   QM_ASSIGN                                        ~8      !0
         18    >   ASSIGN                                                   !0, ~8
   28    19        FETCH_OBJ_R                                      ~11     'baseSalary'
         20        MUL                                              ~12     !0, ~11
         21        ASSIGN_OBJ                                               'salary'
         22        OP_DATA                                                  ~12
   29    23      > RETURN                                                   null

End of function calculatesalary

End of class Analyst.

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

End of function __construct

Function calculatesalary:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
filename:       /in/rbolh
function name:  calculateSalary
number of ops:  24
compiled vars:  !0 = $coef
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ASSIGN                                                   !0, 1
   19     1        FETCH_OBJ_R                                      ~2      'rank'
   20     2        CASE                                                     ~2, 2
          3      > JMPNZ                                                    ~3, ->7
   23     4    >   CASE                                                     ~2, 3
          5      > JMPNZ                                                    ~3, ->9
          6    > > JMP                                                      ->11
   21     7    >   ASSIGN_OP                                     3          !0, 1.25
   22     8      > JMP                                                      ->11
   24     9    >   ASSIGN_OP                                     3          !0, 1.5
   25    10      > JMP                                                      ->11
         11    >   FREE                                                     ~2
   27    12        FETCH_OBJ_R                                      ~6      'isBoss'
         13      > JMPZ                                                     ~6, ->17
         14    >   ASSIGN_OP                                     3  ~7      !0, 1.5
         15        QM_ASSIGN                                        ~8      ~7
         16      > JMP                                                      ->18
         17    >   QM_ASSIGN                                        ~8      !0
         18    >   ASSIGN                                                   !0, ~8
   28    19        FETCH_OBJ_R                                      ~11     'baseSalary'
         20        MUL                                              ~12     !0, ~11
         21        ASSIGN_OBJ                                               'salary'
         22        OP_DATA                                                  ~12
   29    23      > RETURN                                                   null

End of function calculatesalary

End of class Engineer.

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

End of function __construct

Function addemployees:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 6
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 6
Branch analysis from position: 17
Branch analysis from position: 6
filename:       /in/rbolh
function name:  addEmployees
number of ops:  18
compiled vars:  !0 = $position, !1 = $amountEmloyees, !2 = $rank, !3 = $isBoss, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   86     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      1
          3        RECV_INIT                                        !3      <false>
   87     4        ASSIGN                                                   !4, 0
          5      > JMP                                                      ->15
   88     6    >   FETCH_CLASS                                   0  $8      !0
          7        NEW                                              $9      $8
          8        SEND_VAR_EX                                              !2
          9        SEND_VAR_EX                                              !3
         10        DO_FCALL                                      0          
         11        FETCH_OBJ_W                                      $6      'employees'
         12        ASSIGN_DIM                                               $6
         13        OP_DATA                                                  $9
   87    14        PRE_INC                                                  !4
         15    >   IS_SMALLER                                               !4, !1
         16      > JMPNZ                                                    ~12, ->6
   90    17    > > RETURN                                                   null

End of function addemployees

Function totalbydepartment:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/rbolh
function name:  totalByDepartment
number of ops:  31
compiled vars:  !0 = $arr, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   93     0  E >   ASSIGN                                                   !0, <array>
   94     1        FETCH_OBJ_R                                      ~4      'employees'
          2      > FE_RESET_R                                       $5      ~4, ->15
          3    > > FE_FETCH_R                                       ~6      $5, !1, ->15
          4    >   ASSIGN                                                   !2, ~6
   95     5        FETCH_OBJ_R                                      ~9      !1, 'coffee'
          6        ASSIGN_DIM_OP                +=               1          !0, 'coffeeByDept'
          7        OP_DATA                                                  ~9
   96     8        FETCH_OBJ_R                                      ~11     !1, 'pages'
          9        ASSIGN_DIM_OP                +=               1          !0, 'pagesByDept'
         10        OP_DATA                                                  ~11
   97    11        FETCH_OBJ_R                                      ~13     !1, 'salary'
         12        ASSIGN_DIM_OP                +=               1          !0, 'salaryByDept'
         13        OP_DATA                                                  ~13
   94    14      > JMP                                                      ->3
         15    >   FE_FREE                                                  $5
   99    16        FETCH_OBJ_R                    

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.09 ms | 1428 KiB | 15 Q