3v4l.org

run code in 300+ PHP versions simultaneously
<?php $names = [ "Ayush" , "Vaibhav", "Shivam", "Hacker", "Topper", "ABCD", "NameR", "Tammi", "Colgate", "Britney"//, "Bra"//, "Kisser" ]; $addthis = 'ADDTHIS'; $every = 3; $result = array(); $cnt = 0; foreach ($names AS $val) { $result[] = $val; if ($cnt >=3) { $result[] = $addthis; $cnt = 0; } $cnt++; } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 16
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 16
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 14
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/9ASpg
function name:  (null)
number of ops:  21
compiled vars:  !0 = $names, !1 = $addthis, !2 = $every, !3 = $result, !4 = $cnt, !5 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, 'ADDTHIS'
   10     2        ASSIGN                                                   !2, 3
   12     3        ASSIGN                                                   !3, <array>
   13     4        ASSIGN                                                   !4, 0
   14     5      > FE_RESET_R                                       $11     !0, ->16
          6    > > FE_FETCH_R                                               $11, !5, ->16
   15     7    >   ASSIGN_DIM                                               !3
          8        OP_DATA                                                  !5
   16     9        IS_SMALLER_OR_EQUAL                                      3, !4
         10      > JMPZ                                                     ~13, ->14
   17    11    >   ASSIGN_DIM                                               !3
         12        OP_DATA                                                  !1
   18    13        ASSIGN                                                   !4, 0
   20    14    >   PRE_INC                                                  !4
   14    15      > JMP                                                      ->6
         16    >   FE_FREE                                                  $11
   22    17        INIT_FCALL                                               'var_export'
         18        SEND_VAR                                                 !3
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.21 ms | 1015 KiB | 14 Q