3v4l.org

run code in 300+ PHP versions simultaneously
<?php $n = 5; $k = 4; $a = array(1,2,3,4,5); $aSize = count($a);//5 print_r($a); //k left iteration for($i=1; $i<=$k; $i++) { $first = $a[0]; for($j=1; $j<$aSize; $j++) { $a[$j-1]=$a[$j]; } $a[$aSize-1]=$first; } print_r($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 10
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 14
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 10
Branch analysis from position: 27
Branch analysis from position: 10
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 14
Branch analysis from position: 21
Branch analysis from position: 14
filename:       /in/nmgq7
function name:  (null)
number of ops:  31
compiled vars:  !0 = $n, !1 = $k, !2 = $a, !3 = $aSize, !4 = $i, !5 = $first, !6 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 5
    4     1        ASSIGN                                                   !1, 4
    5     2        ASSIGN                                                   !2, <array>
    6     3        COUNT                                            ~10     !2
          4        ASSIGN                                                   !3, ~10
    7     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                                 
    9     8        ASSIGN                                                   !4, 1
          9      > JMP                                                      ->25
   11    10    >   FETCH_DIM_R                                      ~14     !2, 0
         11        ASSIGN                                                   !5, ~14
   12    12        ASSIGN                                                   !6, 1
         13      > JMP                                                      ->19
   14    14    >   SUB                                              ~17     !6, 1
         15        FETCH_DIM_R                                      ~19     !2, !6
         16        ASSIGN_DIM                                               !2, ~17
         17        OP_DATA                                                  ~19
   12    18        PRE_INC                                                  !6
         19    >   IS_SMALLER                                               !6, !3
         20      > JMPNZ                                                    ~21, ->14
   16    21    >   SUB                                              ~22     !3, 1
         22        ASSIGN_DIM                                               !2, ~22
         23        OP_DATA                                                  !5
    9    24        PRE_INC                                                  !4
         25    >   IS_SMALLER_OR_EQUAL                                      !4, !1
         26      > JMPNZ                                                    ~25, ->10
   18    27    >   INIT_FCALL                                               'print_r'
         28        SEND_VAR                                                 !2
         29        DO_ICALL                                                 
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.42 ms | 967 KiB | 14 Q