3v4l.org

run code in 300+ PHP versions simultaneously
<?php class EnrolleeViewHelper extends ViewHelper implements ViewHelperInterface { public function objectToArray(mixed $object): array { if (get_class($object) !== 'Enrollee') { throw new Exception('Этот класс принимает только объекты класса Enrollee.'); } $listFields = $this->getListFields($object); $result = []; foreach ($listFields as $field) { $valueField = isset($object->$field) ? $object->get($field) : ""; $valueField = $this->escapeMetacharacters($valueField); $result [] = $valueField; } return $result; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OqvAD
function name:  (null)
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'enrolleeviewhelper', 'viewhelper'
   23     1      > RETURN                                                   1

Class EnrolleeViewHelper:
Function objecttoarray:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 31
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 31
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 22
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/OqvAD
function name:  objectToArray
number of ops:  36
compiled vars:  !0 = $object, !1 = $listFields, !2 = $result, !3 = $field, !4 = $valueField
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        GET_CLASS                                        ~5      !0
          2        IS_NOT_IDENTICAL                                         ~5, 'Enrollee'
          3      > JMPZ                                                     ~6, ->8
    8     4    >   NEW                                              $7      'Exception'
          5        SEND_VAL_EX                                              '%D0%AD%D1%82%D0%BE%D1%82+%D0%BA%D0%BB%D0%B0%D1%81%D1%81+%D0%BF%D1%80%D0%B8%D0%BD%D0%B8%D0%BC%D0%B0%D0%B5%D1%82+%D1%82%D0%BE%D0%BB%D1%8C%D0%BA%D0%BE+%D0%BE%D0%B1%D1%8A%D0%B5%D0%BA%D1%82%D1%8B+%D0%BA%D0%BB%D0%B0%D1%81%D1%81%D0%B0+Enrollee.'
          6        DO_FCALL                                      0          
          7      > THROW                                         0          $7
   11     8    >   INIT_METHOD_CALL                                         'getListFields'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0  $9      
         11        ASSIGN                                                   !1, $9
   13    12        ASSIGN                                                   !2, <array>
   15    13      > FE_RESET_R                                       $12     !1, ->31
         14    > > FE_FETCH_R                                               $12, !3, ->31
   16    15    >   ISSET_ISEMPTY_PROP_OBJ                                   !0, !3
         16      > JMPZ                                                     ~13, ->22
         17    >   INIT_METHOD_CALL                                         !0, 'get'
         18        SEND_VAR_EX                                              !3
         19        DO_FCALL                                      0  $14     
         20        QM_ASSIGN                                        ~15     $14
         21      > JMP                                                      ->23
         22    >   QM_ASSIGN                                        ~15     ''
         23    >   ASSIGN                                                   !4, ~15
   17    24        INIT_METHOD_CALL                                         'escapeMetacharacters'
         25        SEND_VAR_EX                                              !4
         26        DO_FCALL                                      0  $17     
         27        ASSIGN                                                   !4, $17
   18    28        ASSIGN_DIM                                               !2
         29        OP_DATA                                                  !4
   15    30      > JMP                                                      ->14
         31    >   FE_FREE                                                  $12
   21    32        VERIFY_RETURN_TYPE                                       !2
         33      > RETURN                                                   !2
   22    34*       VERIFY_RETURN_TYPE                                       
         35*     > RETURN                                                   null

End of function objecttoarray

End of class EnrolleeViewHelper.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.21 ms | 1000 KiB | 13 Q