3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ar = []; $ar['ar0']['y'] = 'Yes'; $ar['ar0']['n'] = 'No'; $ar['ar1']['g'] = 'good'; $ar['ar1']['b'] = 'bad'; $ar['ar2']['m'] = 'mom'; $ar['ar2']['d'] = 'dad'; print_r($ar); $res_ar = []; // resultant array $ar_names = []; // array of unique names foreach($ar as $ind => $row){ if (!empty($row['y']) && $row['y'] == 'Yes') $res_ar[$ind] = $row; } print_r($res_ar);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 25, Position 2 = 37
Branch analysis from position: 25
2 jumps found. (Code = 78) Position 1 = 26, Position 2 = 37
Branch analysis from position: 26
2 jumps found. (Code = 46) Position 1 = 30, Position 2 = 33
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 36
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 36
Branch analysis from position: 33
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
filename:       /in/aKSS7
function name:  (null)
number of ops:  42
compiled vars:  !0 = $ar, !1 = $res_ar, !2 = $ar_names, !3 = $row, !4 = $ind
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   QM_ASSIGN                                                !0
   4     1        FETCH_DIM_W                                      $6      !0, 'ar0'
         2        ASSIGN_ADD                                    0          $6, 'y'
         3        OP_DATA                                                  'Yes'
   5     4        FETCH_DIM_W                                      $8      !0, 'ar0'
         5        ASSIGN_ADD                                    0          $8, 'n'
         6        OP_DATA                                                  'No'
   6     7        FETCH_DIM_W                                      $10     !0, 'ar1'
         8        ASSIGN_ADD                                    0          $10, 'g'
         9        OP_DATA                                                  'good'
   7    10        FETCH_DIM_W                                      $12     !0, 'ar1'
        11        ASSIGN_ADD                                    0          $12, 'b'
        12        OP_DATA                                                  'bad'
   8    13        FETCH_DIM_W                                      $14     !0, 'ar2'
        14        ASSIGN_ADD                                    0          $14, 'm'
        15        OP_DATA                                                  'mom'
   9    16        FETCH_DIM_W                                      $16     !0, 'ar2'
        17        ASSIGN_ADD                                    0          $16, 'd'
        18        OP_DATA                                                  'dad'
  10    19        INIT_FCALL                                               'print_r'
        20        SEND_VAR                                                 !0
        21        DO_ICALL                                                 
  11    22        QM_ASSIGN                                                !1
  12    23        QM_ASSIGN                                                !2
  14    24      > FE_RESET_R                                       $21     !0, ->37
        25    > > FE_FETCH_R                                       ~22     $21, !3, ->37
        26    >   QM_ASSIGN                                                !4
  15    27        ISSET_ISEMPTY_DIM_OBJ                         1  ~24     !3, 'y'
        28        BOOL_XOR                                         ~25     ~24
        29      > JMPZ_EX                                          ~25     ~25, ->33
        30    >   FETCH_DIM_R                                      ~26     !3, 'y'
        31        IS_NOT_EQUAL                                     ~27     ~26, 'Yes'
        32        BOOL                                             ~25     ~27
        33    > > JMPZ                                                     ~25, ->36
        34    >   ASSIGN_ADD                                    0          !1, !4
        35        OP_DATA                                                  !3
  14    36    > > JMP                                                      ->25
        37    >   FE_FREE                                                  $21
  18    38        INIT_FCALL                                               'print_r'
        39        SEND_VAR                                                 !1
        40        DO_ICALL                                                 
        41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
233.95 ms | 466 KiB | 7 Q