3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = [1, 2, 3, 7, 8, 9]; $arr2 = [4, 5, 6, 10, 11, 12, 13, 14]; $result = []; for ($i = 0; isset($arr1[$i]) || isset($arr2[$i]); $i += 3) { array_push($result, ...array_slice($arr1, $i, 3), ...array_slice($arr2, $i, 3)); } var_export($result); echo "\n"; var_export($arr1); echo "\n"; var_export($arr2);
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 = 47) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 5
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 47) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
Branch analysis from position: 26
Branch analysis from position: 26
filename:       /in/h3k5J
function name:  (null)
number of ops:  39
compiled vars:  !0 = $arr1, !1 = $arr2, !2 = $result, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    6     2        ASSIGN                                                   !2, <array>
    7     3        ASSIGN                                                   !3, 0
          4      > JMP                                                      ->22
    8     5    >   INIT_FCALL                                               'array_push'
          6        SEND_REF                                                 !2
          7        INIT_FCALL                                               'array_slice'
          8        SEND_VAR                                                 !0
          9        SEND_VAR                                                 !3
         10        SEND_VAL                                                 3
         11        DO_ICALL                                         $8      
         12        SEND_UNPACK                                              $8
         13        INIT_FCALL                                               'array_slice'
         14        SEND_VAR                                                 !1
         15        SEND_VAR                                                 !3
         16        SEND_VAL                                                 3
         17        DO_ICALL                                         $9      
         18        SEND_UNPACK                                              $9
         19        CHECK_UNDEF_ARGS                                         
         20        DO_ICALL                                                 
    7    21        ASSIGN_OP                                     1          !3, 3
         22    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~12     !0, !3
         23      > JMPNZ_EX                                         ~12     ~12, ->26
         24    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~13     !1, !3
         25        BOOL                                             ~12     ~13
         26    > > JMPNZ                                                    ~12, ->5
   10    27    >   INIT_FCALL                                               'var_export'
         28        SEND_VAR                                                 !2
         29        DO_ICALL                                                 
   11    30        ECHO                                                     '%0A'
   12    31        INIT_FCALL                                               'var_export'
         32        SEND_VAR                                                 !0
         33        DO_ICALL                                                 
   13    34        ECHO                                                     '%0A'
   14    35        INIT_FCALL                                               'var_export'
         36        SEND_VAR                                                 !1
         37        DO_ICALL                                                 
         38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.64 ms | 1001 KiB | 16 Q