3v4l.org

run code in 300+ PHP versions simultaneously
<? $names = []; $names[0]['Name'] = 'Rahul'; $names[1]['Name'] = 'Rahul'; $names[2]['Name'] = 'Rahul'; $names[0]['surname'] = 'M'; $names[1]['surname'] = 'D'; $names[2]['surname'] = 'F'; $commonNames = []; if (! empty($names)) { foreach($names as $name) { $commonNames[0][$name['Name']][] = $name['surname']; } } echo '<pre>';print_r($commonNames);echo '</pre>'; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 33
Branch analysis from position: 23
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 32
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 32
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
Branch analysis from position: 33
filename:       /in/ukbeu
function name:  (null)
number of ops:  39
compiled vars:  !0 = $names, !1 = $commonNames, !2 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        FETCH_DIM_W                                      $4      !0, 0
          2        ASSIGN_DIM                                               $4, 'Name'
          3        OP_DATA                                                  'Rahul'
    4     4        FETCH_DIM_W                                      $6      !0, 1
          5        ASSIGN_DIM                                               $6, 'Name'
          6        OP_DATA                                                  'Rahul'
    5     7        FETCH_DIM_W                                      $8      !0, 2
          8        ASSIGN_DIM                                               $8, 'Name'
          9        OP_DATA                                                  'Rahul'
    6    10        FETCH_DIM_W                                      $10     !0, 0
         11        ASSIGN_DIM                                               $10, 'surname'
         12        OP_DATA                                                  'M'
    7    13        FETCH_DIM_W                                      $12     !0, 1
         14        ASSIGN_DIM                                               $12, 'surname'
         15        OP_DATA                                                  'D'
    8    16        FETCH_DIM_W                                      $14     !0, 2
         17        ASSIGN_DIM                                               $14, 'surname'
         18        OP_DATA                                                  'F'
    9    19        ASSIGN                                                   !1, <array>
   10    20        ISSET_ISEMPTY_CV                                 ~17     !0
         21        BOOL_NOT                                         ~18     ~17
         22      > JMPZ                                                     ~18, ->33
   11    23    > > FE_RESET_R                                       $19     !0, ->32
         24    > > FE_FETCH_R                                               $19, !2, ->32
   12    25    >   FETCH_DIM_R                                      ~21     !2, 'Name'
         26        FETCH_DIM_R                                      ~24     !2, 'surname'
         27        FETCH_DIM_W                                      $20     !1, 0
         28        FETCH_DIM_W                                      $22     $20, ~21
         29        ASSIGN_DIM                                               $22
         30        OP_DATA                                                  ~24
   11    31      > JMP                                                      ->24
         32    >   FE_FREE                                                  $19
   16    33    >   ECHO                                                     '%3Cpre%3E'
         34        INIT_FCALL                                               'print_r'
         35        SEND_VAR                                                 !1
         36        DO_ICALL                                                 
         37        ECHO                                                     '%3C%2Fpre%3E'
   17    38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
231.09 ms | 1005 KiB | 14 Q