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; // how often we need to add this $count = ceil(count($names) / $every) - 1; for ($i = 0; $i < $count; $i++) { array_splice($names, $i * ($every + 1) + $every, 0, $addThis); } var_export($names);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 12
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 12
Branch analysis from position: 24
Branch analysis from position: 12
filename:       /in/X0drs
function name:  (null)
number of ops:  28
compiled vars:  !0 = $names, !1 = $addThis, !2 = $every, !3 = $count, !4 = $i
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
   13     3        INIT_FCALL                                               'ceil'
          4        COUNT                                            ~8      !0
          5        DIV                                              ~9      ~8, !2
          6        SEND_VAL                                                 ~9
          7        DO_ICALL                                         $10     
          8        SUB                                              ~11     $10, 1
          9        ASSIGN                                                   !3, ~11
   14    10        ASSIGN                                                   !4, 0
         11      > JMP                                                      ->22
   15    12    >   INIT_FCALL                                               'array_splice'
         13        SEND_REF                                                 !0
         14        ADD                                              ~14     !2, 1
         15        MUL                                              ~15     !4, ~14
         16        ADD                                              ~16     ~15, !2
         17        SEND_VAL                                                 ~16
         18        SEND_VAL                                                 0
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                                 
   14    21        PRE_INC                                                  !4
         22    >   IS_SMALLER                                               !4, !3
         23      > JMPNZ                                                    ~19, ->12
   17    24    >   INIT_FCALL                                               'var_export'
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.98 ms | 1017 KiB | 16 Q