3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = <<<STR THEDLSDARNVNS CCVBXXMTGFRWS CVIYTVBVSDOPTR VBNMAITYSURFD MOTYYERSAWERTY MOITRUHDYRTBDI VNOWUNMBORN STR; $fib = [1,2,3,5,8,13]; foreach (explode(PHP_EOL, $str) as $line) { // hack to make the array 1-based // var_dump($line); $arr = str_split($line); array_unshift($arr, 'foo'); unset($arr[0]); $arr = array_filter($arr); foreach ($arr as $pos => $c) { // start at if ($pos > 9) { $index = $pos % 9; } else { $index = $pos; } // if in $fib array if (in_array($index, $fib)) { echo $c; } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 39
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 39
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 37
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 37
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 29
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 36
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 36
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 36
Branch analysis from position: 35
Branch analysis from position: 36
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 37
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
filename:       /in/CDJGB
function name:  (null)
number of ops:  41
compiled vars:  !0 = $str, !1 = $fib, !2 = $line, !3 = $arr, !4 = $c, !5 = $pos, !6 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'THEDLSDARNVNS+%0ACCVBXXMTGFRWS+%0ACVIYTVBVSDOPTR+%0AVBNMAITYSURFD+%0AMOTYYERSAWERTY+%0AMOITRUHDYRTBDI+%0AVNOWUNMBORN'
   13     1        ASSIGN                                                   !1, <array>
   15     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%0A'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $9      
          6      > FE_RESET_R                                       $10     $9, ->39
          7    > > FE_FETCH_R                                               $10, !2, ->39
   19     8    >   INIT_FCALL                                               'str_split'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                         $11     
         11        ASSIGN                                                   !3, $11
   20    12        INIT_FCALL                                               'array_unshift'
         13        SEND_REF                                                 !3
         14        SEND_VAL                                                 'foo'
         15        DO_ICALL                                                 
   21    16        UNSET_DIM                                                !3, 0
   22    17        INIT_FCALL                                               'array_filter'
         18        SEND_VAR                                                 !3
         19        DO_ICALL                                         $14     
         20        ASSIGN                                                   !3, $14
   24    21      > FE_RESET_R                                       $16     !3, ->37
         22    > > FE_FETCH_R                                       ~17     $16, !4, ->37
         23    >   ASSIGN                                                   !5, ~17
   27    24        IS_SMALLER                                               9, !5
         25      > JMPZ                                                     ~19, ->29
   28    26    >   MOD                                              ~20     !5, 9
         27        ASSIGN                                                   !6, ~20
         28      > JMP                                                      ->30
   30    29    >   ASSIGN                                                   !6, !5
   34    30    >   INIT_FCALL                                               'in_array'
         31        SEND_VAR                                                 !6
         32        SEND_VAR                                                 !1
         33        DO_ICALL                                         $23     
         34      > JMPZ                                                     $23, ->36
   35    35    >   ECHO                                                     !4
   24    36    > > JMP                                                      ->22
         37    >   FE_FREE                                                  $16
   15    38      > JMP                                                      ->7
         39    >   FE_FREE                                                  $10
   40    40      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.08 ms | 1400 KiB | 23 Q