3v4l.org

run code in 500+ PHP versions simultaneously
<?php $a = ['a1','a2','a3','a4']; $b = ['b1','b2','b3','b4']; $c = ['c1','c2','c3','c4']; $all = [ $a, $b, $c ]; $result = []; for( $i=0; $i<count( $a ); $i++ ) { for( $j=0; $j<count( $all ); $j++ ) { $result[] = $all[ 3*(($i+$j*2)%3>0)-(($i+$j*2)%3) ][ $i ]; } } print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 10
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 12
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 10
Branch analysis from position: 33
Branch analysis from position: 10
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 12
Branch analysis from position: 29
Branch analysis from position: 12
filename:       /in/WtDNq
function name:  (null)
number of ops:  37
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $all, !4 = $result, !5 = $i, !6 = $j
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, <array>
    5     2        ASSIGN                                                       !2, <array>
    7     3        INIT_ARRAY                                           ~10     !0
          4        ADD_ARRAY_ELEMENT                                    ~10     !1
          5        ADD_ARRAY_ELEMENT                                    ~10     !2
          6        ASSIGN                                                       !3, ~10
    8     7        ASSIGN                                                       !4, <array>
    9     8        ASSIGN                                                       !5, 0
          9      > JMP                                                          ->30
   11    10    >   ASSIGN                                                       !6, 0
         11      > JMP                                                          ->26
   13    12    >   MUL                                                  ~16     !6, 2
         13        ADD                                                  ~17     !5, ~16
         14        MOD                                                  ~18     ~17, 3
         15        IS_SMALLER                                           ~19     0, ~18
         16        MUL                                                  ~20     ~19, 3
         17        MUL                                                  ~21     !6, 2
         18        ADD                                                  ~22     !5, ~21
         19        MOD                                                  ~23     ~22, 3
         20        SUB                                                  ~24     ~20, ~23
         21        FETCH_DIM_R                                          ~25     !3, ~24
         22        FETCH_DIM_R                                          ~26     ~25, !5
         23        ASSIGN_DIM                                                   !4
         24        OP_DATA                                                      ~26
   11    25        PRE_INC                                                      !6
         26    >   COUNT                                                ~28     !3
         27        IS_SMALLER                                                   !6, ~28
         28      > JMPNZ                                                        ~29, ->12
    9    29    >   PRE_INC                                                      !5
         30    >   COUNT                                                ~31     !0
         31        IS_SMALLER                                                   !5, ~31
         32      > JMPNZ                                                        ~32, ->10
   17    33    >   INIT_FCALL                                                   'print_r'
         34        SEND_VAR                                                     !4
         35        DO_ICALL                                                     
         36      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.26 ms | 1797 KiB | 14 Q