3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = [ ['id' => 1, 'product_name' => 'a'] , ['id' => 2, 'product_name' => 'b'] , ['id' => 3, 'product_name' => 'c'] , ['id' => 4, 'product_name' => 'd'] , ['id' => 5, 'product_name' => 'e'] , ['id' => 6, 'product_name' => 'f'] , ['id' => 7, 'product_name' => 'g'] , ['id' => 8, 'product_name' => 'h'] , ['id' => 9, 'product_name' => 'i'] , ['id' => 10, 'product_name' => 'j'] , ]; ?> <div class="container"> <?php foreach ($result as $key => $value) { if ($key % 3 == 0) { if ($key != 0) { echo ' </div>'.PHP_EOL; } echo ' <div class="row">'.PHP_EOL; } echo ' <div class="col s4">'.$value['product_name'].'</div>'.PHP_EOL; } ?> </div> </div>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 18
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 11
Branch analysis from position: 12
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/vKrf9
function name:  (null)
number of ops:  21
compiled vars:  !0 = $result, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   15     1        ECHO                                                     '%3Cdiv+class%3D%22container%22%3E%0A'
   16     2      > FE_RESET_R                                       $4      !0, ->18
          3    > > FE_FETCH_R                                       ~5      $4, !1, ->18
          4    >   ASSIGN                                                   !2, ~5
   17     5        MOD                                              ~7      !2, 3
          6        IS_EQUAL                                                 ~7, 0
          7      > JMPZ                                                     ~8, ->12
   18     8    >   IS_NOT_EQUAL                                             !2, 0
          9      > JMPZ                                                     ~9, ->11
         10    >   ECHO                                                     '++%3C%2Fdiv%3E%0A'
   19    11    >   ECHO                                                     '++%3Cdiv+class%3D%22row%22%3E%0A'
   21    12    >   FETCH_DIM_R                                      ~10     !1, 'product_name'
         13        CONCAT                                           ~11     '++++%3Cdiv+class%3D%22col+s4%22%3E', ~10
         14        CONCAT                                           ~12     ~11, '%3C%2Fdiv%3E'
         15        CONCAT                                           ~13     ~12, '%0A'
         16        ECHO                                                     ~13
   16    17      > JMP                                                      ->3
         18    >   FE_FREE                                                  $4
   24    19        ECHO                                                     '++%3C%2Fdiv%3E%0A%3C%2Fdiv%3E'
   25    20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.42 ms | 1394 KiB | 13 Q