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]=$first; } var_dump($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 12
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 12
Branch analysis from position: 19
Branch analysis from position: 12
filename:       /in/usia8
function name:  (null)
number of ops:  25
compiled vars:  !0 = $n, !1 = $k, !2 = $a, !3 = $aSize, !4 = $first, !5 = $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                                            ~9      !2
          4        ASSIGN                                                   !3, ~9
    7     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                                 
   11     8        FETCH_DIM_R                                      ~12     !2, 0
          9        ASSIGN                                                   !4, ~12
   12    10        ASSIGN                                                   !5, 1
         11      > JMP                                                      ->17
   14    12    >   SUB                                              ~15     !5, 1
         13        FETCH_DIM_R                                      ~17     !2, !5
         14        ASSIGN_DIM                                               !2, ~15
         15        OP_DATA                                                  ~17
   12    16        PRE_INC                                                  !5
         17    >   IS_SMALLER                                               !5, !3
         18      > JMPNZ                                                    ~19, ->12
   16    19    >   ASSIGN_DIM                                               !2, !3
         20        OP_DATA                                                  !4
   18    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.4 ms | 1395 KiB | 17 Q