3v4l.org

run code in 300+ PHP versions simultaneously
<?php $players = range(1, 32); $count = count($players); // Order players. for ($i = 0; $i < log($count / 2, 2); $i++) { $out = array(); foreach ($players as $player) { $splice = pow(2, $i); $out = array_merge($out, array_splice($players, 0, $splice)); $out = array_merge($out, array_splice($players, -$splice)); } $players = $out; } // Print match list. for ($i = 0; $i < $count; $i++) { printf('%s vs %s<br />%s', $players[$i], $players[++$i], PHP_EOL); } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 9
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 60
Branch analysis from position: 60
2 jumps found. (Code = 44) Position 1 = 62, Position 2 = 50
Branch analysis from position: 62
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 50
2 jumps found. (Code = 44) Position 1 = 62, Position 2 = 50
Branch analysis from position: 62
Branch analysis from position: 50
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 38
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 38
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 9
Branch analysis from position: 48
Branch analysis from position: 9
Branch analysis from position: 38
filename:       /in/NOhsp
function name:  (null)
number of ops:  63
compiled vars:  !0 = $players, !1 = $count, !2 = $i, !3 = $out, !4 = $player, !5 = $splice
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 32
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !0, $6
    3     5        COUNT                                            ~8      !0
          6        ASSIGN                                                   !1, ~8
    6     7        ASSIGN                                                   !2, 0
          8      > JMP                                                      ->41
    7     9    >   ASSIGN                                                   !3, <array>
    9    10      > FE_RESET_R                                       $12     !0, ->38
         11    > > FE_FETCH_R                                               $12, !4, ->38
   10    12    >   INIT_FCALL                                               'pow'
         13        SEND_VAL                                                 2
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                         $13     
         16        ASSIGN                                                   !5, $13
   12    17        INIT_FCALL                                               'array_merge'
         18        SEND_VAR                                                 !3
         19        INIT_FCALL                                               'array_splice'
         20        SEND_REF                                                 !0
         21        SEND_VAL                                                 0
         22        SEND_VAR                                                 !5
         23        DO_ICALL                                         $15     
         24        SEND_VAR                                                 $15
         25        DO_ICALL                                         $16     
         26        ASSIGN                                                   !3, $16
   14    27        INIT_FCALL                                               'array_merge'
         28        SEND_VAR                                                 !3
         29        INIT_FCALL                                               'array_splice'
         30        SEND_REF                                                 !0
         31        MUL                                              ~18     !5, -1
         32        SEND_VAL                                                 ~18
         33        DO_ICALL                                         $19     
         34        SEND_VAR                                                 $19
         35        DO_ICALL                                         $20     
         36        ASSIGN                                                   !3, $20
    9    37      > JMP                                                      ->11
         38    >   FE_FREE                                                  $12
   17    39        ASSIGN                                                   !0, !3
    6    40        PRE_INC                                                  !2
         41    >   INIT_FCALL                                               'log'
         42        DIV                                              ~24     !1, 2
         43        SEND_VAL                                                 ~24
         44        SEND_VAL                                                 2
         45        DO_ICALL                                         $25     
         46        IS_SMALLER                                               !2, $25
         47      > JMPNZ                                                    ~26, ->9
   21    48    >   ASSIGN                                                   !2, 0
         49      > JMP                                                      ->60
   22    50    >   INIT_FCALL                                               'printf'
         51        SEND_VAL                                                 '%25s+vs+%25s%3Cbr+%2F%3E%25s'
         52        FETCH_DIM_R                                      ~28     !0, !2
         53        SEND_VAL                                                 ~28
         54        PRE_INC                                          ~29     !2
         55        FETCH_DIM_R                                      ~30     !0, ~29
         56        SEND_VAL                                                 ~30
         57        SEND_VAL                                                 '%0A'
         58        DO_ICALL                                                 
   21    59        PRE_INC                                                  !2
         60    >   IS_SMALLER                                               !2, !1
         61      > JMPNZ                                                    ~33, ->50
   24    62    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.69 ms | 1400 KiB | 25 Q