3v4l.org

run code in 300+ PHP versions simultaneously
<?php $environments = [ 'qa-only' => [], 'prd-only' => [], 'both' => [] ]; $qa = file('qa.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); $prd = file('prd.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); foreach($prd as $key => $env) { if(in_array($env, $qa)) { $environments['both'][] = $env; } else { $environments['prd-only'][] = $env; } } foreach($qa as $key => $env) { if(in_array($env, $prd) && !in_array($env, $environments['both'])) { $environments['both'][] = $env; } else { $environments['qa-only'][] = $env; } } print_r($environments);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 27
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 27
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 23
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 27
2 jumps found. (Code = 77) Position 1 = 29, Position 2 = 52
Branch analysis from position: 29
2 jumps found. (Code = 78) Position 1 = 30, Position 2 = 52
Branch analysis from position: 30
2 jumps found. (Code = 46) Position 1 = 36, Position 2 = 43
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 48
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 51
Branch analysis from position: 51
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
Branch analysis from position: 43
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 52
Branch analysis from position: 27
filename:       /in/FEtvh
function name:  (null)
number of ops:  57
compiled vars:  !0 = $environments, !1 = $qa, !2 = $prd, !3 = $env, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        INIT_FCALL                                               'file'
          2        SEND_VAL                                                 'qa.txt'
          3        SEND_VAL                                                 6
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
   10     6        INIT_FCALL                                               'file'
          7        SEND_VAL                                                 'prd.txt'
          8        SEND_VAL                                                 6
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !2, $8
   12    11      > FE_RESET_R                                       $10     !2, ->27
         12    > > FE_FETCH_R                                       ~11     $10, !3, ->27
         13    >   ASSIGN                                                   !4, ~11
   13    14        INIT_FCALL                                               'in_array'
         15        SEND_VAR                                                 !3
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $13     
         18      > JMPZ                                                     $13, ->23
   14    19    >   FETCH_DIM_W                                      $14     !0, 'both'
         20        ASSIGN_DIM                                               $14
         21        OP_DATA                                                  !3
   13    22      > JMP                                                      ->26
   16    23    >   FETCH_DIM_W                                      $16     !0, 'prd-only'
         24        ASSIGN_DIM                                               $16
         25        OP_DATA                                                  !3
   12    26    > > JMP                                                      ->12
         27    >   FE_FREE                                                  $10
   20    28      > FE_RESET_R                                       $18     !1, ->52
         29    > > FE_FETCH_R                                       ~19     $18, !3, ->52
         30    >   ASSIGN                                                   !4, ~19
   21    31        INIT_FCALL                                               'in_array'
         32        SEND_VAR                                                 !3
         33        SEND_VAR                                                 !2
         34        DO_ICALL                                         $21     
         35      > JMPZ_EX                                          ~22     $21, ->43
         36    >   INIT_FCALL                                               'in_array'
         37        SEND_VAR                                                 !3
         38        FETCH_DIM_R                                      ~23     !0, 'both'
         39        SEND_VAL                                                 ~23
         40        DO_ICALL                                         $24     
         41        BOOL_NOT                                         ~25     $24
         42        BOOL                                             ~22     ~25
         43    > > JMPZ                                                     ~22, ->48
   22    44    >   FETCH_DIM_W                                      $26     !0, 'both'
         45        ASSIGN_DIM                                               $26
         46        OP_DATA                                                  !3
   21    47      > JMP                                                      ->51
   24    48    >   FETCH_DIM_W                                      $28     !0, 'qa-only'
         49        ASSIGN_DIM                                               $28
         50        OP_DATA                                                  !3
   20    51    > > JMP                                                      ->29
         52    >   FE_FREE                                                  $18
   28    53        INIT_FCALL                                               'print_r'
         54        SEND_VAR                                                 !0
         55        DO_ICALL                                                 
         56      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.54 ms | 1433 KiB | 16 Q