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]; for($i=0,$j=$n;$i<$n;$i++,$j++){ $tmp1=$arr[$j]; printIt($arr); echo("\n"); $arr[$i]=$tmp0; $tmp0=$arr[$i]; $arr[$i]=$tmp1; } 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 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 7
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 7
Branch analysis from position: 23
Branch analysis from position: 7
filename:       /in/Pjgjp
function name:  (null)
number of ops:  27
compiled vars:  !0 = $arr, !1 = $n, !2 = $tmp0, !3 = $i, !4 = $j, !5 = $tmp1
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
    7     4        ASSIGN                                                   !3, 0
          5        ASSIGN                                                   !4, !1
          6      > JMP                                                      ->21
    8     7    >   FETCH_DIM_R                                      ~12     !0, !4
          8        ASSIGN                                                   !5, ~12
    9     9        INIT_FCALL_BY_NAME                                       'printIt'
         10        SEND_VAR_EX                                              !0
         11        DO_FCALL                                      0          
   10    12        ECHO                                                     '%0A'
   11    13        ASSIGN_DIM                                               !0, !3
         14        OP_DATA                                                  !2
   12    15        FETCH_DIM_R                                      ~16     !0, !3
         16        ASSIGN                                                   !2, ~16
   14    17        ASSIGN_DIM                                               !0, !3
         18        OP_DATA                                                  !5
    7    19        PRE_INC                                                  !3
         20        PRE_INC                                                  !4
         21    >   IS_SMALLER                                               !3, !1
         22      > JMPNZ                                                    ~21, ->7
   17    23    >   INIT_FCALL_BY_NAME                                       'printIt'
         24        SEND_VAR_EX                                              !0
         25        DO_FCALL                                      0          
   24    26      > 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/Pjgjp
function name:  printIt
number of ops:  11
compiled vars:  !0 = $arr, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->7
   21     3    >   FETCH_DIM_R                                      ~3      !0, !1
          4        CONCAT                                           ~4      ~3, '++'
          5        ECHO                                                     ~4
   20     6        PRE_INC                                                  !1
          7    >   COUNT                                            ~6      !0
          8        IS_SMALLER                                               !1, ~6
          9      > JMPNZ                                                    ~7, ->3
   23    10    > > RETURN                                                   null

End of function printit

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.61 ms | 1399 KiB | 13 Q