3v4l.org

run code in 300+ PHP versions simultaneously
<section id="explore"> <div class="container-fluid"> <h2 class="white fs-h1">Explore</h2> <div class="compass"></div> </div> <!-- .container-fluid --> <?php # Random fields. $img_field = 3;//get_field('images'); $quotes_field = 5;//get_field('quotes'); # Long chain of destructuring to get random items from these: if($img_field && $quotes_field): $img_rand_keys = array_rand($img_field, 3); $quotes_rand_keys = array_rand($quotes_field, 3); $rand_imgs = [ $img_field[ $img_rand_keys[0] ]["image"], $img_field[ $img_rand_keys[1] ]["image"], $img_field[ $img_rand_keys[2] ]["image"], ]; $rand_quotes = [ $quotes_field[ $quotes_rand_keys[0] ]["quote"], $quotes_field[ $quotes_rand_keys[1] ]["quote"], $quotes_field[ $quotes_rand_keys[2] ]["quote"], ]; endif; # $img_field && $quotes_field ?> <div class="explore-grid container"> <?php # For the 6 items.. for($i=0;$i<6;$i++): if($i%2==0): // "Evens" ?> <div class="grid-item grid-item--quote col"> <div class="fontawesome five-stars"></div> <p>"<?php echo $rand_quotes[ floor(i/2) ] ?>"</p> </div> <? else: // "Odds" ?> <div class="grid-item grid-item--image col"> <img src="<?php echo $rand_imgs[ floor(i/2) ] ?>" /> </div> <? endif; // if..else endfor; // for($i=0..5) ?> </div> <!-- .explore-grid --> </section> <!-- #explore -->
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 42
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 68
Branch analysis from position: 68
2 jumps found. (Code = 44) Position 1 = 70, Position 2 = 45
Branch analysis from position: 70
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 58
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 67
Branch analysis from position: 67
2 jumps found. (Code = 44) Position 1 = 70, Position 2 = 45
Branch analysis from position: 70
Branch analysis from position: 45
Branch analysis from position: 58
2 jumps found. (Code = 44) Position 1 = 70, Position 2 = 45
Branch analysis from position: 70
Branch analysis from position: 45
Branch analysis from position: 42
Branch analysis from position: 5
filename:       /in/O9TR8
function name:  (null)
number of ops:  72
compiled vars:  !0 = $img_field, !1 = $quotes_field, !2 = $img_rand_keys, !3 = $quotes_rand_keys, !4 = $rand_imgs, !5 = $rand_quotes, !6 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%3Csection+id%3D%22explore%22%3E%0A++%3Cdiv+class%3D%22container-fluid%22%3E%0A++++%3Ch2+class%3D%22white+fs-h1%22%3EExplore%3C%2Fh2%3E%0A++++%3Cdiv+class%3D%22compass%22%3E%3C%2Fdiv%3E%0A++%3C%2Fdiv%3E+%3C%21--+.container-fluid+--%3E%0A+%0A'
    8     1        ASSIGN                                                   !0, 3
    9     2        ASSIGN                                                   !1, 5
   12     3      > JMPZ_EX                                          ~9      !0, ->5
          4    >   BOOL                                             ~9      !1
          5    > > JMPZ                                                     ~9, ->42
   13     6    >   INIT_FCALL                                               'array_rand'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 3
          9        DO_ICALL                                         $10     
         10        ASSIGN                                                   !2, $10
   14    11        INIT_FCALL                                               'array_rand'
         12        SEND_VAR                                                 !1
         13        SEND_VAL                                                 3
         14        DO_ICALL                                         $12     
         15        ASSIGN                                                   !3, $12
   17    16        FETCH_DIM_R                                      ~14     !2, 0
         17        FETCH_DIM_R                                      ~15     !0, ~14
         18        FETCH_DIM_R                                      ~16     ~15, 'image'
         19        INIT_ARRAY                                       ~17     ~16
   18    20        FETCH_DIM_R                                      ~18     !2, 1
         21        FETCH_DIM_R                                      ~19     !0, ~18
         22        FETCH_DIM_R                                      ~20     ~19, 'image'
         23        ADD_ARRAY_ELEMENT                                ~17     ~20
   19    24        FETCH_DIM_R                                      ~21     !2, 2
         25        FETCH_DIM_R                                      ~22     !0, ~21
         26        FETCH_DIM_R                                      ~23     ~22, 'image'
         27        ADD_ARRAY_ELEMENT                                ~17     ~23
   16    28        ASSIGN                                                   !4, ~17
   23    29        FETCH_DIM_R                                      ~25     !3, 0
         30        FETCH_DIM_R                                      ~26     !1, ~25
         31        FETCH_DIM_R                                      ~27     ~26, 'quote'
         32        INIT_ARRAY                                       ~28     ~27
   24    33        FETCH_DIM_R                                      ~29     !3, 1
         34        FETCH_DIM_R                                      ~30     !1, ~29
         35        FETCH_DIM_R                                      ~31     ~30, 'quote'
         36        ADD_ARRAY_ELEMENT                                ~28     ~31
   25    37        FETCH_DIM_R                                      ~32     !3, 2
         38        FETCH_DIM_R                                      ~33     !1, ~32
         39        FETCH_DIM_R                                      ~34     ~33, 'quote'
         40        ADD_ARRAY_ELEMENT                                ~28     ~34
   22    41        ASSIGN                                                   !5, ~28
   28    42    >   ECHO                                                     '+%0A++%3Cdiv+class%3D%22explore-grid+container%22%3E%0A++++'
   31    43        ASSIGN                                                   !6, 0
         44      > JMP                                                      ->68
   32    45    >   MOD                                              ~37     !6, 2
         46        IS_EQUAL                                                 ~37, 0
         47      > JMPZ                                                     ~38, ->58
   33    48    >   ECHO                                                     '++++++++%3Cdiv+class%3D%22grid-item+grid-item--quote+col%22%3E%0A++++++++++%3Cdiv+class%3D%22fontawesome+five-stars%22%3E%EF%80%85%EF%80%85%EF%80%85%EF%80%85%EF%80%85%3C%2Fdiv%3E%0A++++++++++%3Cp%3E%22'
   35    49        INIT_FCALL                                               'floor'
         50        FETCH_CONSTANT                                   ~39     'i'
         51        DIV                                              ~40     ~39, 2
         52        SEND_VAL                                                 ~40
         53        DO_ICALL                                         $41     
         54        FETCH_DIM_R                                      ~42     !5, $41
         55        ECHO                                                     ~42
         56        ECHO                                                     '%22%3C%2Fp%3E%0A++++++++%3C%2Fdiv%3E+'
         57      > JMP                                                      ->67
   38    58    >   ECHO                                                     '++++++++%3Cdiv+class%3D%22grid-item+grid-item--image+col%22%3E%0A++++++++++%3Cimg+src%3D%22'
   39    59        INIT_FCALL                                               'floor'
         60        FETCH_CONSTANT                                   ~43     'i'
         61        DIV                                              ~44     ~43, 2
         62        SEND_VAL                                                 ~44
         63        DO_ICALL                                         $45     
         64        FETCH_DIM_R                                      ~46     !4, $45
         65        ECHO                                                     ~46
         66        ECHO                                                     '%22+%2F%3E%0A++++++++%3C%2Fdiv%3E%0A++++++'
   31    67    >   PRE_INC                                                  !6
         68    >   IS_SMALLER                                               !6, 6
         69      > JMPNZ                                                    ~48, ->45
   44    70    >   ECHO                                                     '++%3C%2Fdiv%3E+%3C%21--+.explore-grid+--%3E%0A+%0A%3C%2Fsection%3E+%3C%21--+%23explore+--%3E'
   46    71      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.96 ms | 1400 KiB | 17 Q