3v4l.org

run code in 300+ PHP versions simultaneously
<?php $labels = array("Element1","Element2","Element3","Element4","Element5","Element6"); $i = 1; foreach($labels as $label) { echo $label; // add a comma if the label is not the last if($i < count($labels)) { echo ", "; } // $i%2 is 0 when $i is even if($i%2==0) { echo "<br>"; // or echo "\n"; } $i++; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 13
Branch analysis from position: 9
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/uokdW
function name:  (null)
number of ops:  17
compiled vars:  !0 = $labels, !1 = $i, !2 = $label
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 1
    6     2      > FE_RESET_R                                       $5      !0, ->15
          3    > > FE_FETCH_R                                               $5, !2, ->15
    7     4    >   ECHO                                                     !2
   10     5        COUNT                                            ~6      !0
          6        IS_SMALLER                                               !1, ~6
          7      > JMPZ                                                     ~7, ->9
   11     8    >   ECHO                                                     '%2C+'
   15     9    >   MOD                                              ~8      !1, 2
         10        IS_EQUAL                                                 ~8, 0
         11      > JMPZ                                                     ~9, ->13
   16    12    >   ECHO                                                     '%3Cbr%3E'
   18    13    >   PRE_INC                                                  !1
    6    14      > JMP                                                      ->3
         15    >   FE_FREE                                                  $5
   21    16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.57 ms | 1385 KiB | 13 Q