3v4l.org

run code in 500+ PHP versions simultaneously
<?php $contents = array('content1', 'content2', 'content3', 'content4'); $types = array('pdf', 'pdf', 'txt', 'pdf'); $links = array('link1', 'link2', 'link3'); $skip_type =0; foreach ($contents as $key => $value) { echo "$value\n"; if ($types[$key] == 'pdf') { echo $links[$key + $skip_type]."\n"; }else{ $skip_type--; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 20
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 20
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/GcT2q
function name:  (null)
number of ops:  22
compiled vars:  !0 = $contents, !1 = $types, !2 = $links, !3 = $skip_type, !4 = $value, !5 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, <array>
    5     2        ASSIGN                                                       !2, <array>
    6     3        ASSIGN                                                       !3, 0
    7     4      > FE_RESET_R                                           $10     !0, ->20
          5    > > FE_FETCH_R                                           ~11     $10, !4, ->20
          6    >   ASSIGN                                                       !5, ~11
    9     7        NOP                                                          
          8        FAST_CONCAT                                          ~13     !4, '%0A'
          9        ECHO                                                         ~13
   11    10        FETCH_DIM_R                                          ~14     !1, !5
         11        IS_EQUAL                                                     ~14, 'pdf'
         12      > JMPZ                                                         ~15, ->18
   12    13    >   ADD                                                  ~16     !5, !3
         14        FETCH_DIM_R                                          ~17     !2, ~16
         15        CONCAT                                               ~18     ~17, '%0A'
         16        ECHO                                                         ~18
   11    17      > JMP                                                          ->19
   14    18    >   PRE_DEC                                                      !3
    7    19    > > JMP                                                          ->5
         20    >   FE_FREE                                                      $10
   17    21      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.38 ms | 2025 KiB | 13 Q