3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array('status_date' => 'abc'); if (isset($data['protocol_id'])) { $data = array($data); } $protocols = array(); try { foreach ($data as $_data) { $protocol = new Protocol(); $protocol->setProtocolId($_data['protocol_id']) ->setReference($_data['reference']) ->setCommand($_data['command']) ->setCommandType($_data['command_type']) ->setRequest($_data['request']) ->setResponse($_data['response']) ->setResponse($_data['initiator']) ->setCreationDate(new \DateTime($_data['creation_date'], new \DateTimeZone('UTC'))); if (!empty($_data['fleet_id'])) { $protocol->setFleet(new Fleet($_data['fleet_id'])); } $protocols[] = $protocol; } } catch (\Exception $e) { throw new \IllegalArgumentException('Error when trying to map result into Protocol object'); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 72
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 72
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 69
Branch analysis from position: 61
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 69
Branch analysis from position: 72
1 jumps found. (Code = 42) Position 1 = 79
Branch analysis from position: 79
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 72
Branch analysis from position: 5
Found catch point at position: 74
Branch analysis from position: 74
2 jumps found. (Code = 107) Position 1 = 75, Position 2 = -2
Branch analysis from position: 75
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/4P40R
function name:  (null)
number of ops:  80
compiled vars:  !0 = $data, !1 = $protocols, !2 = $_data, !3 = $protocol, !4 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ISSET_ISEMPTY_DIM_OBJ                         0          !0, 'protocol_id'
          2      > JMPZ                                                     ~6, ->5
    6     3    >   INIT_ARRAY                                       ~7      !0
          4        ASSIGN                                                   !0, ~7
    9     5    >   ASSIGN                                                   !1, <array>
   13     6      > FE_RESET_R                                       $10     !0, ->72
          7    > > FE_FETCH_R                                               $10, !2, ->72
   14     8    >   NEW                                              $11     'Protocol'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !3, $11
   16    11        INIT_METHOD_CALL                                         !3, 'setProtocolId'
         12        CHECK_FUNC_ARG                                           
         13        FETCH_DIM_FUNC_ARG                               $14     !2, 'protocol_id'
         14        SEND_FUNC_ARG                                            $14
         15        DO_FCALL                                      0  $15     
   17    16        INIT_METHOD_CALL                                         $15, 'setReference'
         17        CHECK_FUNC_ARG                                           
         18        FETCH_DIM_FUNC_ARG                               $16     !2, 'reference'
         19        SEND_FUNC_ARG                                            $16
         20        DO_FCALL                                      0  $17     
   18    21        INIT_METHOD_CALL                                         $17, 'setCommand'
         22        CHECK_FUNC_ARG                                           
         23        FETCH_DIM_FUNC_ARG                               $18     !2, 'command'
         24        SEND_FUNC_ARG                                            $18
         25        DO_FCALL                                      0  $19     
   19    26        INIT_METHOD_CALL                                         $19, 'setCommandType'
         27        CHECK_FUNC_ARG                                           
         28        FETCH_DIM_FUNC_ARG                               $20     !2, 'command_type'
         29        SEND_FUNC_ARG                                            $20
         30        DO_FCALL                                      0  $21     
   20    31        INIT_METHOD_CALL                                         $21, 'setRequest'
         32        CHECK_FUNC_ARG                                           
         33        FETCH_DIM_FUNC_ARG                               $22     !2, 'request'
         34        SEND_FUNC_ARG                                            $22
         35        DO_FCALL                                      0  $23     
   21    36        INIT_METHOD_CALL                                         $23, 'setResponse'
         37        CHECK_FUNC_ARG                                           
         38        FETCH_DIM_FUNC_ARG                               $24     !2, 'response'
         39        SEND_FUNC_ARG                                            $24
         40        DO_FCALL                                      0  $25     
   22    41        INIT_METHOD_CALL                                         $25, 'setResponse'
         42        CHECK_FUNC_ARG                                           
         43        FETCH_DIM_FUNC_ARG                               $26     !2, 'initiator'
         44        SEND_FUNC_ARG                                            $26
         45        DO_FCALL                                      0  $27     
   23    46        INIT_METHOD_CALL                                         $27, 'setCreationDate'
         47        NEW                                              $28     'DateTime'
         48        CHECK_FUNC_ARG                                           
         49        FETCH_DIM_FUNC_ARG                               $29     !2, 'creation_date'
         50        SEND_FUNC_ARG                                            $29
         51        NEW                                              $30     'DateTimeZone'
         52        SEND_VAL_EX                                              'UTC'
         53        DO_FCALL                                      0          
         54        SEND_VAR_NO_REF_EX                                       $30
         55        DO_FCALL                                      0          
         56        SEND_VAR_NO_REF_EX                                       $28
         57        DO_FCALL                                      0          
   25    58        ISSET_ISEMPTY_DIM_OBJ                         1  ~34     !2, 'fleet_id'
         59        BOOL_NOT                                         ~35     ~34
         60      > JMPZ                                                     ~35, ->69
   26    61    >   INIT_METHOD_CALL                                         !3, 'setFleet'
         62        NEW                                              $36     'Fleet'
         63        CHECK_FUNC_ARG                                           
         64        FETCH_DIM_FUNC_ARG                               $37     !2, 'fleet_id'
         65        SEND_FUNC_ARG                                            $37
         66        DO_FCALL                                      0          
         67        SEND_VAR_NO_REF_EX                                       $36
         68        DO_FCALL                                      0          
   29    69    >   ASSIGN_DIM                                               !1
         70        OP_DATA                                                  !3
   13    71      > JMP                                                      ->7
         72    >   FE_FREE                                                  $10
         73      > JMP                                                      ->79
   32    74  E > > CATCH                                       last         'Exception'
   33    75    >   NEW                                              $41     'IllegalArgumentException'
         76        SEND_VAL_EX                                              'Error+when+trying+to+map+result+into+Protocol+object'
         77        DO_FCALL                                      0          
         78      > THROW                                         0          $41
   34    79    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.87 ms | 1403 KiB | 13 Q