3v4l.org

run code in 300+ PHP versions simultaneously
<?php $regions = [ 'int' => 1, 'nl' => 2, 'be' => 4, 'us' => 8, 'as' => 16, 'za' => 32, ]; for ($i = 0; ++$i < 1 << count($regions); array_walk($regions, function ($x, $region) use (&$list, $i) { if (!($i & $x)) return; if (isset($list[$region])) $list[$region] .= ",$i"; else $list[$region] = $i; })); var_dump($list); unset($list); foreach ($regions as $region => $x) for ($i = $x; end($regions) * 2 - $i > 0; ++$i%$x?:$i+=$x){var_dump($i, $x, end($regions) * 2 - $i); if (isset($list[$region])) $list[$region] .= ",$i"; else $list[$region] = $i;} var_dump($list);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 3
Branch analysis from position: 15
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 57
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 57
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
2 jumps found. (Code = 44) Position 1 = 56, Position 2 = 24
Branch analysis from position: 56
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 41
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
2 jumps found. (Code = 44) Position 1 = 56, Position 2 = 24
Branch analysis from position: 56
Branch analysis from position: 24
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 56, Position 2 = 24
Branch analysis from position: 56
Branch analysis from position: 24
Branch analysis from position: 57
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 57
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 3
Branch analysis from position: 15
Branch analysis from position: 3
filename:       /in/tG3RC
function name:  (null)
number of ops:  62
compiled vars:  !0 = $regions, !1 = $i, !2 = $list, !3 = $x, !4 = $region
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   12     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->10
          3    >   INIT_FCALL                                               'array_walk'
          4        SEND_REF                                                 !0
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FtG3RC%3A12%240'
          6        BIND_LEXICAL                                             ~7, !2
          7        BIND_LEXICAL                                             ~7, !1
          8        SEND_VAL                                                 ~7
          9        DO_ICALL                                                 
         10    >   PRE_INC                                          ~9      !1
         11        COUNT                                            ~10     !0
         12        SL                                               ~11     1, ~10
         13        IS_SMALLER                                               ~9, ~11
         14      > JMPNZ                                                    ~12, ->3
   14    15    >   INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                                 
   16    18        UNSET_CV                                                 !2
   18    19      > FE_RESET_R                                       $14     !0, ->57
         20    > > FE_FETCH_R                                       ~15     $14, !3, ->57
         21    >   ASSIGN                                                   !4, ~15
   19    22        ASSIGN                                                   !1, !3
         23      > JMP                                                      ->49
         24    >   INIT_FCALL                                               'var_dump'
         25        SEND_VAR                                                 !1
         26        SEND_VAR                                                 !3
         27        INIT_FCALL                                               'end'
         28        SEND_REF                                                 !0
         29        DO_ICALL                                         $18     
         30        MUL                                              ~19     $18, 2
         31        SUB                                              ~20     ~19, !1
         32        SEND_VAL                                                 ~20
         33        DO_ICALL                                                 
   20    34        ISSET_ISEMPTY_DIM_OBJ                         0          !2, !4
         35      > JMPZ                                                     ~22, ->41
   21    36    >   NOP                                                      
         37        FAST_CONCAT                                      ~24     '%2C', !1
         38        ASSIGN_DIM_OP                .=               8          !2, !4
         39        OP_DATA                                                  ~24
         40      > JMP                                                      ->43
   23    41    >   ASSIGN_DIM                                               !2, !4
         42        OP_DATA                                                  !1
   19    43    >   PRE_INC                                          ~26     !1
         44        MOD                                              ~27     ~26, !3
         45        JMP_SET                                          ~28     ~27, ->48
         46        ASSIGN_OP                                     1  ~29     !1, !3
         47        QM_ASSIGN                                        ~28     ~29
         48        FREE                                                     ~28
         49    >   INIT_FCALL                                               'end'
         50        SEND_REF                                                 !0
         51        DO_ICALL                                         $30     
         52        MUL                                              ~31     $30, 2
         53        SUB                                              ~32     ~31, !1
         54        IS_SMALLER                                               0, ~32
         55      > JMPNZ                                                    ~33, ->24
   18    56    > > JMP                                                      ->20
         57    >   FE_FREE                                                  $14
   25    58        INIT_FCALL                                               'var_dump'
         59        SEND_VAR                                                 !2
         60        DO_ICALL                                                 
         61      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FtG3RC%3A12%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tG3RC
function name:  {closure}
number of ops:  18
compiled vars:  !0 = $x, !1 = $region, !2 = $list, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
          3        BIND_STATIC                                              !3
          4        BW_AND                                           ~4      !3, !0
          5        BOOL_NOT                                         ~5      ~4
          6      > JMPZ                                                     ~5, ->8
          7    > > RETURN                                                   null
          8    >   ISSET_ISEMPTY_DIM_OBJ                         0          !2, !1
          9      > JMPZ                                                     ~6, ->15
         10    >   NOP                                                      
         11        FAST_CONCAT                                      ~8      '%2C', !3
         12        ASSIGN_DIM_OP                .=               8          !2, !1
         13        OP_DATA                                                  ~8
         14      > JMP                                                      ->17
         15    >   ASSIGN_DIM                                               !2, !1
         16        OP_DATA                                                  !3
         17    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FtG3RC%3A12%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.1 ms | 1404 KiB | 19 Q