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; for ( $count = count($names), $pos = $count - ($count % $every); $pos > 0; $pos -= $every ) { array_splice($names, $pos, 0, $addThis); } var_export($names);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 9
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 9
Branch analysis from position: 18
Branch analysis from position: 9
filename:       /in/FlTc0
function name:  (null)
number of ops:  22
compiled vars:  !0 = $names, !1 = $addThis, !2 = $every, !3 = $count, !4 = $pos
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        COUNT                                            ~8      !0
          4        ASSIGN                                                   !3, ~8
          5        MOD                                              ~10     !3, !2
          6        SUB                                              ~11     !3, ~10
          7        ASSIGN                                                   !4, ~11
          8      > JMP                                                      ->16
   17     9    >   INIT_FCALL                                               'array_splice'
         10        SEND_REF                                                 !0
         11        SEND_VAR                                                 !4
         12        SEND_VAL                                                 0
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
   15    15        ASSIGN_OP                                     2          !4, !2
   14    16    >   IS_SMALLER                                               0, !4
         17      > JMPNZ                                                    ~15, ->9
   19    18    >   INIT_FCALL                                               'var_export'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.53 ms | 999 KiB | 15 Q