3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Created by PhpStorm. * User: Саша * Date: 17.03.2017 * Time: 20:25 */ class Employee { public $rank = 1; public $coffee = 0; public $pages = 0; public $basicSalary = 0; public $boss = false; function __construct($rank, $boss = false) { $this->rank = $rank; $this->boss = $boss; } public function getSalary() { $rate = 0; if ($this->boss == true) { $bossRank = 1.5; } else { $bossRank = 1; } switch ($this->rank) { case 1: $rate = 1; break; case 2: $rate = 1.25; break; case 3: $rate = 1.5; break; } $rate *= $bossRank; return $this->basicSalary * $rate; } public function getCoffee() { if ($this->boss == true) { return $this->coffee * 2; } else { return $this->coffee; } } public function getPages() { if ($this->boss) { return 0; } else { return $this->pages; } } } class Manager extends Employee { public $rank = 1; public $boss = false; } class Marketer extends Employee { public $rank = 1; public $boss = false; } class Engineer extends Employee { public $rank = 1; public $boss = false; } class Analyst extends Employee { public $rank = 1; public $boss = false; } class Department { private $employees = []; private $name; function __construct($name) { $this->name = $name; } public function addEmployee($profession, $number, $rank = 1, $boss = false) { $variable = ''; for ($i = 0; $i < $number; $i++) { $variable = new $profession($rank, $boss); switch ($profession) { case 'Manager': $variable->basicSalary = 500; $variable->coffee = 20; $variable->pages = 200; break; case 'Marketer': $variable->basicSalary = 400; $variable->coffee = 15; $variable->pages = 150; break; case 'Engineer': $variable->basicSalary = 200; $variable->coffee = 5; $variable->pages = 50; break; case 'Analyst': $variable->basicSalary = 800; $variable->coffee = 50; $variable->pages = 5; break; } $this->employees[] = $variable; } } public function getName() { return $this->name; } public function getEmployeesNumber() { return count($this->employees); } public function getAllDepartmentSalary() { $result = 0; foreach ($this->employees as $employee) { $result += $employee->getSalary(); } return $result; } public function getAllDepartmentCoffee() { $result = 0; foreach ($this->employees as $employee) { $result += $employee->getCoffee(); } return $result; } public function getAllDepartmentPages() { $result = 0; foreach ($this->employees as $employee) { $result += $employee->getPages(); } return $result; } } function padRight($x, $y) { return $x . str_repeat(" ", $y - mb_strlen($x)); } function padLeft($x, $y) { return str_repeat(" ", $y - mb_strlen($x)) . $x; } function getTheValues($departments) { $col1 = 15; $col2 = 11; $countedColumns = $col1 + ($col2 * 5); $numberOfDepartments = count($departments); $allEmployees = 0; $allSalary = 0; $allCoffee = 0; $allPages = 0; $allMoneyPerPage = 0; echo padRight("Департамент", $col1) . padLeft("сотр.", $col2) . padLeft("тугр.", $col2) . padLeft("кофе", $col2) . padLeft("стр.", $col2) . padLeft("тугр./стр.", $col2) ."\n"; echo str_repeat("-", $countedColumns) ."\n"; foreach ($departments as $department) { $name = $department->getName(); $employees = $department->getEmployeesNumber(); $salary = $department->getAllDepartmentSalary(); $coffee = $department->getAllDepartmentCoffee(); $pages = $department->getAllDepartmentPages(); $moneyPerPage = round($salary / $pages, 2); echo padRight($name, $col1) . padLeft($employees, $col2) . padLeft($salary, $col2) . padLeft($coffee, $col2) . padLeft($pages, $col2) . padLeft($moneyPerPage, $col2) ."\n"; $allEmployees += $employees; $allSalary += $salary; $allCoffee += $coffee; $allPages += $pages; $allMoneyPerPage += $moneyPerPage; } echo str_repeat("-", $countedColumns) ."\n"; echo padRight("Среднее", $col1) . padLeft($allEmployees/$numberOfDepartments, $col2) . padLeft($allSalary/$numberOfDepartments, $col2) . padLeft($allCoffee/$numberOfDepartments, $col2) . padLeft($allPages/$numberOfDepartments, $col2) . padLeft($allMoneyPerPage/$numberOfDepartments, $col2) ."\n"; echo padRight("Всего", $col1) . padLeft($allEmployees, $col2) . padLeft($allSalary, $col2) . padLeft($allCoffee, $col2) . padLeft($allPages, $col2) . padLeft($allMoneyPerPage, $col2) ."\n"; } $procurementDepartment = new Department("Закупок"); $procurementDepartment->AddEmployee('Manager', 9); $procurementDepartment->AddEmployee('Manager', 3, 2); $procurementDepartment->AddEmployee('Manager', 2, 3); $procurementDepartment->AddEmployee('Marketer', 2, 1); $procurementDepartment->AddEmployee('Manager', 1, 2, true); $sellingDepartment = new Department("Продаж"); $sellingDepartment->AddEmployee('Manager', 12); $sellingDepartment->AddEmployee('Marketer', 6); $sellingDepartment->AddEmployee('Analyst', 3); $sellingDepartment->AddEmployee('Analyst', 2, 2); $sellingDepartment->AddEmployee('Manager', 1, 2, true); $advertisingDepartment = new Department("Рекламы"); $advertisingDepartment->AddEmployee('Marketer', 15); $advertisingDepartment->AddEmployee('Marketer', 10, 2); $advertisingDepartment->AddEmployee('Manager', 8); $advertisingDepartment->AddEmployee('Engineer', 2); $advertisingDepartment->AddEmployee('Manager', 1, 3, true); $logisticsDepartment = new Department("Логистики"); $logisticsDepartment->AddEmployee('Manager', 13); $logisticsDepartment->AddEmployee('Manager', 5, 2); $logisticsDepartment->AddEmployee('Engineer', 5); $logisticsDepartment->AddEmployee('Manager', 1, 1, true); $departments = [$procurementDepartment, $sellingDepartment, $advertisingDepartment, $logisticsDepartment]; getTheValues($departments);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mHNMJ
function name:  (null)
number of ops:  115
compiled vars:  !0 = $procurementDepartment, !1 = $sellingDepartment, !2 = $advertisingDepartment, !3 = $logisticsDepartment, !4 = $departments
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  219     0  E >   NEW                                              $5      'Department'
          1        SEND_VAL_EX                                              '%D0%97%D0%B0%D0%BA%D1%83%D0%BF%D0%BE%D0%BA'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $5
  221     4        INIT_METHOD_CALL                                         !0, 'AddEmployee'
          5        SEND_VAL_EX                                              'Manager'
          6        SEND_VAL_EX                                              9
          7        DO_FCALL                                      0          
  222     8        INIT_METHOD_CALL                                         !0, 'AddEmployee'
          9        SEND_VAL_EX                                              'Manager'
         10        SEND_VAL_EX                                              3
         11        SEND_VAL_EX                                              2
         12        DO_FCALL                                      0          
  223    13        INIT_METHOD_CALL                                         !0, 'AddEmployee'
         14        SEND_VAL_EX                                              'Manager'
         15        SEND_VAL_EX                                              2
         16        SEND_VAL_EX                                              3
         17        DO_FCALL                                      0          
  224    18        INIT_METHOD_CALL                                         !0, 'AddEmployee'
         19        SEND_VAL_EX                                              'Marketer'
         20        SEND_VAL_EX                                              2
         21        SEND_VAL_EX                                              1
         22        DO_FCALL                                      0          
  225    23        INIT_METHOD_CALL                                         !0, 'AddEmployee'
         24        SEND_VAL_EX                                              'Manager'
         25        SEND_VAL_EX                                              1
         26        SEND_VAL_EX                                              2
         27        SEND_VAL_EX                                              <true>
         28        DO_FCALL                                      0          
  227    29        NEW                                              $13     'Department'
         30        SEND_VAL_EX                                              '%D0%9F%D1%80%D0%BE%D0%B4%D0%B0%D0%B6'
         31        DO_FCALL                                      0          
         32        ASSIGN                                                   !1, $13
  229    33        INIT_METHOD_CALL                                         !1, 'AddEmployee'
         34        SEND_VAL_EX                                              'Manager'
         35        SEND_VAL_EX                                              12
         36        DO_FCALL                                      0          
  230    37        INIT_METHOD_CALL                                         !1, 'AddEmployee'
         38        SEND_VAL_EX                                              'Marketer'
         39        SEND_VAL_EX                                              6
         40        DO_FCALL                                      0          
  231    41        INIT_METHOD_CALL                                         !1, 'AddEmployee'
         42        SEND_VAL_EX                                              'Analyst'
         43        SEND_VAL_EX                                              3
         44        DO_FCALL                                      0          
  232    45        INIT_METHOD_CALL                                         !1, 'AddEmployee'
         46        SEND_VAL_EX                                              'Analyst'
         47        SEND_VAL_EX                                              2
         48        SEND_VAL_EX                                              2
         49        DO_FCALL                                      0          
  233    50        INIT_METHOD_CALL                                         !1, 'AddEmployee'
         51        SEND_VAL_EX                                              'Manager'
         52        SEND_VAL_EX                                              1
         53        SEND_VAL_EX                                              2
         54        SEND_VAL_EX                                              <true>
         55        DO_FCALL                                      0          
  235    56        NEW                                              $21     'Department'
         57        SEND_VAL_EX                                              '%D0%A0%D0%B5%D0%BA%D0%BB%D0%B0%D0%BC%D1%8B'
         58        DO_FCALL                                      0          
         59        ASSIGN                                                   !2, $21
  237    60        INIT_METHOD_CALL                                         !2, 'AddEmployee'
         61        SEND_VAL_EX                                              'Marketer'
         62        SEND_VAL_EX                                              15
         63        DO_FCALL                                      0          
  238    64        INIT_METHOD_CALL                                         !2, 'AddEmployee'
         65        SEND_VAL_EX                                              'Marketer'
         66        SEND_VAL_EX                                              10
         67        SEND_VAL_EX                                              2
         68        DO_FCALL                                      0          
  239    69        INIT_METHOD_CALL                                         !2, 'AddEmployee'
         70        SEND_VAL_EX                                              'Manager'
         71        SEND_VAL_EX                                              8
         72        DO_FCALL                                      0          
  240    73        INIT_METHOD_CALL                                         !2, 'AddEmployee'
         74        SEND_VAL_EX                                              'Engineer'
         75        SEND_VAL_EX                                              2
         76        DO_FCALL                                      0          
  241    77        INIT_METHOD_CALL                                         !2, 'AddEmployee'
         78        SEND_VAL_EX                                              'Manager'
         79        SEND_VAL_EX                                              1
         80        SEND_VAL_EX                                              3
         81        SEND_VAL_EX                                              <true>
         82        DO_FCALL                                      0          
  243    83        NEW                                              $29     'Department'
         84        SEND_VAL_EX                                              '%D0%9B%D0%BE%D0%B3%D0%B8%D1%81%D1%82%D0%B8%D0%BA%D0%B8'
         85        DO_FCALL                                      0          
         86        ASSIGN                                                   !3, $29
  245    87        INIT_METHOD_CALL                                         !3, 'AddEmployee'
         88        SEND_VAL_EX                                              'Manager'
         89        SEND_VAL_EX                                              13
         90        DO_FCALL                                      0          
  246    91        INIT_METHOD_CALL                                         !3, 'AddEmployee'
         92        SEND_VAL_EX                                              'Manager'
         93        SEND_VAL_EX                                              5
         94        SEND_VAL_EX                                              2
         95        DO_FCALL                                      0          
  247    96        INIT_METHOD_CALL                                         !3, 'AddEmployee'
         97        SEND_VAL_EX                                              'Engineer'
         98        SEND_VAL_EX                                              5
         99        DO_FCALL                                      0          
  248   100        INIT_METHOD_CALL                                         !3, 'AddEmployee'
        101        SEND_VAL_EX                                              'Manager'
        102        SEND_VAL_EX                                              1
        103        SEND_VAL_EX                                              1
        104        SEND_VAL_EX                                              <true>
        105        DO_FCALL                                      0          
  250   106        INIT_ARRAY                                       ~36     !0
        107        ADD_ARRAY_ELEMENT                                ~36     !1
        108        ADD_ARRAY_ELEMENT                                ~36     !2
        109        ADD_ARRAY_ELEMENT                                ~36     !3
        110        ASSIGN                                                   !4, ~36
  252   111        INIT_FCALL                                               'getthevalues'
        112        SEND_VAR                                                 !4
        113        DO_FCALL                                      0          
        114      > RETURN                                                   1

Function padright:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mHNMJ
function name:  padRight
number of ops:  13
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  153     0  E >   RECV                                             !0      
          1        RECV                                             !1      
  154     2        INIT_FCALL                                               'str_repeat'
          3        SEND_VAL                                                 '+'
          4        INIT_FCALL                                               'mb_strlen'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7        SUB                                              ~3      !1, $2
          8        SEND_VAL                                                 ~3
          9        DO_ICALL                                         $4      
         10        CONCAT                                           ~5      !0, $4
         11      > RETURN                                                   ~5
  155    12*     > RETURN                                                   null

End of function padright

Function padleft:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mHNMJ
function name:  padLeft
number of ops:  13
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  156     0  E >   RECV                                             !0      
          1        RECV                                             !1      
  157     2        INIT_FCALL                                               'str_repeat'
          3        SEND_VAL                                                 '+'
          4        INIT_FCALL                                               'mb_strlen'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7        SUB                                              ~3      !1, $2
          8        SEND_VAL                                                 ~3
          9        DO_ICALL                                         $4      
         10        CONCAT                                           ~5      $4, !0
         11      > RETURN                                                   ~5
  158    12*     > RETURN                                                   null

End of function padleft

Function getthevalues:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 51, Position 2 = 110
Branch analysis from position: 51
2 jumps found. (Code = 78) Position 1 = 52, Position 2 = 110
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 51
Branch analysis from position: 51
Branch analysis from position: 110
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 110
filename:       /in/mHNMJ
function name:  getTheValues
number of ops:  185
compiled vars:  !0 = $departments, !1 = $col1, !2 = $col2, !3 = $countedColumns, !4 = $numberOfDepartments, !5 = $allEmployees, !6 = $allSalary, !7 = $allCoffee, !8 = $allPages, !9 = $allMoneyPerPage, !10 = $department, !11 = $name, !12 = $employees, !13 = $salary, !14 = $coffee, !15 = $pages, !16 = $moneyPerPage
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  160     0  E >   RECV                                             !0      
  162     1        ASSIGN                                                   !1, 15
  163     2        ASSIGN                                                   !2, 11
  164     3        MUL                                              ~19     !2, 5
          4        ADD                                              ~20     !1, ~19
          5        ASSIGN                                                   !3, ~20
  165     6        COUNT                                            ~22     !0
          7        ASSIGN                                                   !4, ~22
  166     8        ASSIGN                                                   !5, 0
  167     9        ASSIGN                                                   !6, 0
  168    10        ASSIGN                                                   !7, 0
  169    11        ASSIGN                                                   !8, 0
  170    12        ASSIGN                                                   !9, 0
  172    13        INIT_FCALL                                               'padright'
         14        SEND_VAL                                                 '%D0%94%D0%B5%D0%BF%D0%B0%D1%80%D1%82%D0%B0%D0%BC%D0%B5%D0%BD%D1%82'
         15        SEND_VAR                                                 !1
         16        DO_FCALL                                      0  $29     
  173    17        INIT_FCALL                                               'padleft'
         18        SEND_VAL                                                 '%D1%81%D0%BE%D1%82%D1%80.'
         19        SEND_VAR                                                 !2
         20        DO_FCALL                                      0  $30     
         21        CONCAT                                           ~31     $29, $30
  174    22        INIT_FCALL                                               'padleft'
         23        SEND_VAL                                                 '%D1%82%D1%83%D0%B3%D1%80.'
         24        SEND_VAR                                                 !2
         25        DO_FCALL                                      0  $32     
         26        CONCAT                                           ~33     ~31, $32
  175    27        INIT_FCALL                                               'padleft'
         28        SEND_VAL                                                 '%D0%BA%D0%BE%D1%84%D0%B5'
         29        SEND_VAR                                                 !2
         30        DO_FCALL                                      0  $34     
         31        CONCAT                                           ~35     ~33, $34
  176    32        INIT_FCALL                                               'padleft'
         33        SEND_VAL                                                 '%D1%81%D1%82%D1%80.'
         34        SEND_VAR                                                 !2
         35        DO_FCALL                                      0  $36     
         36        CONCAT                                           ~37     ~35, $36
  177    37        INIT_FCALL                                               'padleft'
         38        SEND_VAL                                                 '%D1%82%D1%83%D0%B3%D1%80.%2F%D1%81%D1%82%D1%80.'
         39        SEND_VAR                                                 !2
         40        DO_FCALL                                      0  $38     
         41        CONCAT                                           ~39     ~37, $38
         42        CONCAT                                           ~40     ~39, '%0A'
         43        ECHO                                                     ~40
  179    44        INIT_FCALL                                               'str_repeat'
         45        SEND_VAL                                                 '-'
         46        SEND_VAR                                                 !3
         47        DO_ICALL                                         $41     
         48        CONCAT                                           ~42     $41, '%0A'
         49        ECHO                                                     ~42
  181    50      > FE_RESET_R                                       $43     !0, ->110
         51    > > FE_FETCH_R                                               $43, !10, ->110
  182    52    >   INIT_METHOD_CALL                                         !10, 'getName'
         53        DO_FCALL                                      0  $44     
         54        ASSIGN                                                   !11, $44
  183    55        INIT_METHOD_CALL                                         !10, 'getEmployeesNumber'
         56        DO_FCALL                                      0  $46     
         57        ASSIGN                                                   !12, $46
  184    58        INIT_METHOD_CALL                                         !10, 'getAllDepartmentSalary'
         59        DO_FCALL                                      0  $48     
         60        ASSIGN                                                   !13, $48
  185    61        INIT_METHOD_CALL                                         !10, 'getAllDepartmentCoffee'
         62        DO_FCALL                                      0  $50     
         63        ASSIGN                                                   !14, $50
  186    64        INIT_METHOD_CALL                                         !10, 'getAllDepartmentPages'
         65        DO_FCALL                                      0  $52     
         66        ASSIGN                                                   !15, $52
  187    67        INIT_FCALL                                               'round'
         68        DIV                                              ~54     !13, !15
         69        SEND_VAL                                                 ~54
         70        SEND_VAL                                                 2
         71        DO_ICALL                                         $55     
         72        ASSIGN                                                   !16, $55
  189    73        INIT_FCALL                                               'padright'
         74        SEND_VAR                                                 !11
         75        SEND_VAR                                                 !1
         76        DO_FCALL                                      0  $57     
  190    77        INIT_FCALL                                               'padleft'
         78        SEND_VAR                                                 !12
         79        SEND_VAR                                                 !2
         80        DO_FCALL                                      0  $58     
         81        CONCAT                                           ~59     $57, $58
  191    82        INIT_FCALL                                               'padleft'
         83        SEND_VAR                                                 !13
         84        SEND_VAR                                                 !2
         85        DO_FCALL                                      0  $60     
         86        CONCAT                                           ~61     ~59, $60
  192    87        INIT_FCALL                                               'padleft'
         88        SEND_VAR                                                 !14
         89        SEND_VAR                                                 !2
         90        DO_FCALL                                      0  $62     
         91        CONCAT                                           ~63     ~61, $62
  193    92        INIT_FCALL                                               'padleft'
         93        SEND_VAR                                                 !15
         94        SEND_VAR                                                 !2
         95        DO_FCALL                                      0  $64     
         96        CONCAT                                           ~65     ~63, $64
  194    97        INIT_FCALL                                               'padleft'
         98        SEND_VAR                                                 !16
         99        SEND_VAR                                                 !2
        100        DO_FCALL                                      0  $66     
        101        CONCAT                                           ~67     ~65, $66
        102        CONCAT                                           ~68     ~67, '%0A'
        103        ECHO                                                     ~68
  196   104        ASSIGN_OP                                     1          !5, !12
  197   105        ASSIGN_OP                                     1          !6, !13
  198   106        ASSIGN_OP                                     1          !7, !14
  199   107        ASSIGN_OP                                     1          !8, !15
  200   108        ASSIGN_OP                                     1          !9, !16
  181   109      > JMP                                                      ->51
        110    >   FE_FREE                                                  $43
  202   111        INIT_FCALL                                               'str_repeat'
        112        SEND_VAL                                                 '-'
        113        SEND_VAR                                                 !3
        114        DO_ICALL                                         $74     
        115        CONCAT                                           ~75     $74, '%0A'
        116        ECHO                                                     ~75
  204   117        INIT_FCALL                                               'padright'
        118        SEND_VAL                                                 '%D0%A1%D1%80%D0%B5%D0%B4%D0%BD%D0%B5%D0%B5'
        119        SEND_VAR                                                 !1
        120        DO_FCALL                                      0  $76     
  205   121        INIT_FCALL                                               'padleft'
        122        DIV                                              ~77     !5, !4
        123        SEND_VAL                                                 ~77
        124        SEND_VAR                                                 !2
        125        DO_FCALL                                      0  $78     
        126        CONCAT                                           ~79     $76, $78
  206   127        INIT_FCALL                                               'padleft'
        128        DIV                                              ~80     !6, !4
        129        SEND_VAL                                                 ~80
        130        SEND_VAR                                                 !2
        131        DO_FCALL                                      0  $81     
        132        CONCAT                                           ~82     ~79, $81
  207   133        INIT_FCALL                                               'padleft'
        134        DIV                                              ~83     !7, !4
        135        SEND_VAL                                                 ~83
        136        SEND_VAR                                                 !2
        137        DO_FCALL                                      0  $84     
        138        CONCAT                                           ~85     ~82, $84
  208   139        INIT_FCALL                                               'padleft'
        140        DIV                                              ~86     !8, !4
        141        SEND_VAL                                                 ~86
        142        SEND_VAR                                                 !2
        143        DO_FCALL                                      0  $87     
        144        CONCAT                                           ~88     ~85, $87
  209   145        INIT_FCALL                                               'padleft'
        146        DIV                                              ~89     !9, !4
        147        SEND_VAL                                                 ~89
        148        SEND_VAR                                                 !2
        149        DO_FCALL                                      0  $90     
        150        CONCAT                                           ~91     ~88, $90
        151        CONCAT                                           ~92     ~91, '%0A'
        152        ECHO                                                     ~92
  211   153        INIT_FCALL                                               'padright'
        154        SEND_VAL                                                 '%D0%92%D1%81%D0%B5%D0%B3%D0%BE'
        155        SEND_VAR                                                 !1
        156        DO_FCALL                                      0  $93     
  212   157        INIT_FCALL                                               'padleft'
        158        SEND_VAR                                                 !5
        159        SEND_VAR                                                 !2
        160        DO_FCALL                                      0  $94     
        161        CONCAT                                           ~95     $93, $94
  213   162        INIT_FCALL                                               'padleft'
        163        SEND_VAR                                                 !6
        164        SEND_VAR                                                 !2
        165        DO_FCALL                                      0  $96     
        166        CONCAT                                           ~97     ~95, $96
  214   167        INIT_FCALL                                               'padleft'
        168        SEND_VAR                                                 !7
        169        SEND_VAR                                                 !2
        170        DO_FCALL                                      0  $98     
        171        CONCAT                                           ~99     ~97, $98
  215   172        INIT_FCALL                                               'padleft'
        173        SEND_VAR                                                 !8
        174        SEND_VAR                                                 !2
        175        DO_FCALL                                      0  $100    
        176        CONCAT                                           ~101    ~99, $100
  216   177        INIT_FCALL                                               'padleft'
        178        SEND_VAR                                                 !9
        179        SEND_VAR                                                 !2
        180        DO_FCALL                                      0  $102    
        181        CONCAT                                           ~103    ~101, $102
        182        CONCAT                                           ~104    ~103, '%0A'
        183        ECHO                                                     ~104
  217   184      > RETURN                                                   null

End of function getthevalues

Class Employee:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mHNMJ
function name:  __construct
number of ops:  7
compiled vars:  !0 = $rank, !1 = $boss
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <false>
   17     2        ASSIGN_OBJ                                               'rank'
          3        OP_DATA                                                  !0
   18     4        ASSIGN_OBJ                                               'boss'
          5        OP_DATA                                                  !1
   19     6      > RETURN                                                   null

End of function __construct

Function getsalary:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 17
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
Branch analysis from position: 15
filename:       /in/mHNMJ
function name:  getSalary
number of ops:  27
compiled vars:  !0 = $rate, !1 = $bossRank
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   ASSIGN                                                   !0, 0
   23     1        FETCH_OBJ_R                                      ~3      'boss'
          2        BOOL                                             ~4      ~3
          3      > JMPZ                                                     ~4, ->6
   24     4    >   ASSIGN                                                   !1, 1.5
          5      > JMP                                                      ->7
   26     6    >   ASSIGN                                                   !1, 1
   28     7    >   FETCH_OBJ_R                                      ~7      'rank'
   29     8        CASE                                 

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
203.05 ms | 1435 KiB | 44 Q