3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); $total = 12; $skip = 4; $numberLeft = 1; for ($i = 1; $i <= $total; $i++){ $positions[$i] = $i; } for ($i = $total; $i >= $skip; $i--){ if ($total - $numberLeft < $skip - 1){ $numberLeft = $skip - ($total - $numberLeft) - 1; } else { $numberLeft = $numberLeft + $skip - 1; } for($j = $numberLeft; $j < $total; $j++){ $positions[$j] = $positions[$j+1]; } unset($positions[$total]); $total--; } echo "Выигрышные места: ".implode(", ", $positions);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 8
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 15
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 24
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 29
Branch analysis from position: 36
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 15
Branch analysis from position: 41
Branch analysis from position: 15
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 29
Branch analysis from position: 36
Branch analysis from position: 29
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 8
Branch analysis from position: 13
Branch analysis from position: 8
filename:       /in/dDAaI
function name:  (null)
number of ops:  48
compiled vars:  !0 = $total, !1 = $skip, !2 = $numberLeft, !3 = $i, !4 = $positions, !5 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 -1
          2        DO_ICALL                                                 
    5     3        ASSIGN                                                   !0, 12
    6     4        ASSIGN                                                   !1, 4
    7     5        ASSIGN                                                   !2, 1
    9     6        ASSIGN                                                   !3, 1
          7      > JMP                                                      ->11
   10     8    >   ASSIGN_DIM                                               !4, !3
          9        OP_DATA                                                  !3
    9    10        PRE_INC                                                  !3
         11    >   IS_SMALLER_OR_EQUAL                                      !3, !0
         12      > JMPNZ                                                    ~13, ->8
   13    13    >   ASSIGN                                                   !3, !0
         14      > JMP                                                      ->39
   14    15    >   SUB                                              ~15     !0, !2
         16        SUB                                              ~16     !1, 1
         17        IS_SMALLER                                               ~15, ~16
         18      > JMPZ                                                     ~17, ->24
   15    19    >   SUB                                              ~18     !0, !2
         20        SUB                                              ~19     !1, ~18
         21        SUB                                              ~20     ~19, 1
         22        ASSIGN                                                   !2, ~20
         23      > JMP                                                      ->27
   17    24    >   ADD                                              ~22     !2, !1
         25        SUB                                              ~23     ~22, 1
         26        ASSIGN                                                   !2, ~23
   20    27    >   ASSIGN                                                   !5, !2
         28      > JMP                                                      ->34
   21    29    >   ADD                                              ~27     !5, 1
         30        FETCH_DIM_R                                      ~28     !4, ~27
         31        ASSIGN_DIM                                               !4, !5
         32        OP_DATA                                                  ~28
   20    33        PRE_INC                                                  !5
         34    >   IS_SMALLER                                               !5, !0
         35      > JMPNZ                                                    ~30, ->29
   24    36    >   UNSET_DIM                                                !4, !0
   25    37        PRE_DEC                                                  !0
   13    38        PRE_DEC                                                  !3
         39    >   IS_SMALLER_OR_EQUAL                                      !1, !3
         40      > JMPNZ                                                    ~33, ->15
   28    41    >   INIT_FCALL                                               'implode'
         42        SEND_VAL                                                 '%2C+'
         43        SEND_VAR                                                 !4
         44        DO_ICALL                                         $34     
         45        CONCAT                                           ~35     '%D0%92%D1%8B%D0%B8%D0%B3%D1%80%D1%8B%D1%88%D0%BD%D1%8B%D0%B5+%D0%BC%D0%B5%D1%81%D1%82%D0%B0%3A+', $34
         46        ECHO                                                     ~35
         47      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.43 ms | 1400 KiB | 17 Q