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) << 1 - $i > 0; ++$i%$x?:$i+=$x) 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 = 47
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 47
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 24
Branch analysis from position: 46
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 = 26, Position 2 = 31
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 24
Branch analysis from position: 46
Branch analysis from position: 24
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 24
Branch analysis from position: 46
Branch analysis from position: 24
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
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/LOcLr
function name:  (null)
number of ops:  52
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%2FLOcLr%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, ->47
         20    > > FE_FETCH_R                                       ~15     $14, !3, ->47
         21    >   ASSIGN                                                   !4, ~15
   19    22        ASSIGN                                                   !1, !3
         23      > JMP                                                      ->39
   20    24    >   ISSET_ISEMPTY_DIM_OBJ                         0          !2, !4
         25      > JMPZ                                                     ~18, ->31
   21    26    >   NOP                                                      
         27        FAST_CONCAT                                      ~20     '%2C', !1
         28        ASSIGN_DIM_OP                .=               8          !2, !4
         29        OP_DATA                                                  ~20
         30      > JMP                                                      ->33
   23    31    >   ASSIGN_DIM                                               !2, !4
         32        OP_DATA                                                  !1
   19    33    >   PRE_INC                                          ~22     !1
         34        MOD                                              ~23     ~22, !3
         35        JMP_SET                                          ~24     ~23, ->38
         36        ASSIGN_OP                                     1  ~25     !1, !3
         37        QM_ASSIGN                                        ~24     ~25
         38        FREE                                                     ~24
         39    >   INIT_FCALL                                               'end'
         40        SEND_REF                                                 !0
         41        DO_ICALL                                         $26     
         42        SUB                                              ~27     1, !1
         43        SL                                               ~28     $26, ~27
         44        IS_SMALLER                                               0, ~28
         45      > JMPNZ                                                    ~29, ->24
   18    46    > > JMP                                                      ->20
         47    >   FE_FREE                                                  $14
   25    48        INIT_FCALL                                               'var_dump'
         49        SEND_VAR                                                 !2
         50        DO_ICALL                                                 
         51      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FLOcLr%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/LOcLr
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%2FLOcLr%3A12%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.3 ms | 1409 KiB | 19 Q