3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [1, 2, 3, 4, 5, 6, 7, 8, 9]; foreach ($array as $i => $v) { $group = (int) ($i / 4); if (isset($result[$group])) { $result[$group] .= ", $v"; } else { $result[$group] = "$v"; } } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 18
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/vs8jV
function name:  (null)
number of ops:  23
compiled vars:  !0 = $array, !1 = $v, !2 = $i, !3 = $group, !4 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1      > FE_RESET_R                                       $6      !0, ->18
          2    > > FE_FETCH_R                                       ~7      $6, !1, ->18
          3    >   ASSIGN                                                   !2, ~7
    6     4        DIV                                              ~9      !2, 4
          5        CAST                                          4  ~10     ~9
          6        ASSIGN                                                   !3, ~10
    7     7        ISSET_ISEMPTY_DIM_OBJ                         0          !4, !3
          8      > JMPZ                                                     ~12, ->14
    8     9    >   NOP                                                      
         10        FAST_CONCAT                                      ~14     '%2C+', !1
         11        ASSIGN_DIM_OP                .=               8          !4, !3
         12        OP_DATA                                                  ~14
    7    13      > JMP                                                      ->17
   10    14    >   CAST                                          6  ~16     !1
         15        ASSIGN_DIM                                               !4, !3
         16        OP_DATA                                                  ~16
    5    17    > > JMP                                                      ->2
         18    >   FE_FREE                                                  $6
   13    19        INIT_FCALL                                               'var_export'
         20        SEND_VAR                                                 !4
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.96 ms | 1010 KiB | 14 Q