3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cnt = 5; $array = array_fill(1, ($cnt), '-'); for($i=1;$i<($cnt+2);$i++){ array_shift($array); array_push($array, $i); echo implode(" ", $array); echo "\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 9
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 9
Branch analysis from position: 26
Branch analysis from position: 9
filename:       /in/cHCrl
function name:  (null)
number of ops:  27
compiled vars:  !0 = $cnt, !1 = $array, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 5
    3     1        INIT_FCALL                                               'array_fill'
          2        SEND_VAL                                                 1
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 '-'
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !1, $4
    5     7        ASSIGN                                                   !2, 1
          8      > JMP                                                      ->23
    6     9    >   INIT_FCALL                                               'array_shift'
         10        SEND_REF                                                 !1
         11        DO_ICALL                                                 
    7    12        INIT_FCALL                                               'array_push'
         13        SEND_REF                                                 !1
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                                 
    8    16        INIT_FCALL                                               'implode'
         17        SEND_VAL                                                 '+'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $9      
         20        ECHO                                                     $9
    9    21        ECHO                                                     '%0A'
    5    22        PRE_INC                                                  !2
         23    >   ADD                                              ~11     !0, 2
         24        IS_SMALLER                                               !2, ~11
         25      > JMPNZ                                                    ~12, ->9
   10    26    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.6 ms | 1395 KiB | 21 Q