3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(1,2,3,4,5,6,7,8,9,10,'a','b','c','d','e','f','g','h','i','j'); $n=10; $tmp0 = $arr[0]; $tmp1 = $arr[$n]; for($i=0,$j=$n;$i<19;$i++,$j++){ printIt($arr); echo("\n"); if($i%2==0){ $tmp0=$arr[$i]; } $arr[$i]=$tmp0; if($i%2==1){ $tmp0=$arr[$i+1]; } $i++; $arr[$i]=$tmp1; $tmp1=$arr[$j+1]; } printIt($arr); function printIt($arr){ for($i=0;$i<count($arr);$i++){ echo($arr[$i]." "); } } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 9
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 26
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 9
Branch analysis from position: 36
Branch analysis from position: 9
Branch analysis from position: 26
Branch analysis from position: 18
filename:       /in/F11hC
function name:  (null)
number of ops:  40
compiled vars:  !0 = $arr, !1 = $n, !2 = $tmp0, !3 = $tmp1, !4 = $i, !5 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 10
    5     2        FETCH_DIM_R                                      ~8      !0, 0
          3        ASSIGN                                                   !2, ~8
    6     4        FETCH_DIM_R                                      ~10     !0, !1
          5        ASSIGN                                                   !3, ~10
    8     6        ASSIGN                                                   !4, 0
          7        ASSIGN                                                   !5, !1
          8      > JMP                                                      ->34
    9     9    >   INIT_FCALL_BY_NAME                                       'printIt'
         10        SEND_VAR_EX                                              !0
         11        DO_FCALL                                      0          
   10    12        ECHO                                                     '%0A'
   11    13        MOD                                              ~15     !4, 2
         14        IS_EQUAL                                                 ~15, 0
         15      > JMPZ                                                     ~16, ->18
   12    16    >   FETCH_DIM_R                                      ~17     !0, !4
         17        ASSIGN                                                   !2, ~17
   14    18    >   ASSIGN_DIM                                               !0, !4
         19        OP_DATA                                                  !2
   15    20        MOD                                              ~20     !4, 2
         21        IS_EQUAL                                                 ~20, 1
         22      > JMPZ                                                     ~21, ->26
   16    23    >   ADD                                              ~22     !4, 1
         24        FETCH_DIM_R                                      ~23     !0, ~22
         25        ASSIGN                                                   !2, ~23
   18    26    >   PRE_INC                                                  !4
   19    27        ASSIGN_DIM                                               !0, !4
         28        OP_DATA                                                  !3
   20    29        ADD                                              ~27     !5, 1
         30        FETCH_DIM_R                                      ~28     !0, ~27
         31        ASSIGN                                                   !3, ~28
    8    32        PRE_INC                                                  !4
         33        PRE_INC                                                  !5
         34    >   IS_SMALLER                                               !4, 19
         35      > JMPNZ                                                    ~32, ->9
   23    36    >   INIT_FCALL_BY_NAME                                       'printIt'
         37        SEND_VAR_EX                                              !0
         38        DO_FCALL                                      0          
   30    39      > RETURN                                                   1

Function printit:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
Branch analysis from position: 3
filename:       /in/F11hC
function name:  printIt
number of ops:  11
compiled vars:  !0 = $arr, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
   26     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->7
   27     3    >   FETCH_DIM_R                                      ~3      !0, !1
          4        CONCAT                                           ~4      ~3, '++'
          5        ECHO                                                     ~4
   26     6        PRE_INC                                                  !1
          7    >   COUNT                                            ~6      !0
          8        IS_SMALLER                                               !1, ~6
          9      > JMPNZ                                                    ~7, ->3
   29    10    > > RETURN                                                   null

End of function printit

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.63 ms | 1390 KiB | 13 Q