3v4l.org

run code in 300+ PHP versions simultaneously
<?php $images = range(1, 35); $perRow = 6; foreach ($images as $i => $image) { if ($i % $perRow === 0) { echo "-- row-open"; } echo sprintf(" [ %d ] ", $image); if (($i + 1) % $perRow === 0) { echo "-- row-close\n"; // check if a another full row exists // if not, break if (!array_key_exists($i + $perRow, $images)) { break; } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 29
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 29
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 28
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 28
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 28
Branch analysis from position: 13
Branch analysis from position: 29
Branch analysis from position: 29
filename:       /in/95gg7
function name:  (null)
number of ops:  31
compiled vars:  !0 = $images, !1 = $perRow, !2 = $image, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 35
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !0, $4
    4     5        ASSIGN                                                   !1, 6
    6     6      > FE_RESET_R                                       $7      !0, ->29
          7    > > FE_FETCH_R                                       ~8      $7, !2, ->29
          8    >   ASSIGN                                                   !3, ~8
    7     9        MOD                                              ~10     !3, !1
         10        IS_IDENTICAL                                             ~10, 0
         11      > JMPZ                                                     ~11, ->13
    8    12    >   ECHO                                                     '--+row-open'
   11    13    >   INIT_FCALL                                               'sprintf'
         14        SEND_VAL                                                 '+%5B+%25d+%5D+'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $12     
         17        ECHO                                                     $12
   13    18        ADD                                              ~13     !3, 1
         19        MOD                                              ~14     ~13, !1
         20        IS_IDENTICAL                                             ~14, 0
         21      > JMPZ                                                     ~15, ->28
   14    22    >   ECHO                                                     '--+row-close%0A'
   18    23        ADD                                              ~16     !3, !1
         24        ARRAY_KEY_EXISTS                                 ~17     ~16, !0
         25        BOOL_NOT                                         ~18     ~17
         26      > JMPZ                                                     ~18, ->28
   19    27    > > JMP                                                      ->29
    6    28    > > JMP                                                      ->7
         29    >   FE_FREE                                                  $7
   22    30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.21 ms | 1396 KiB | 17 Q