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); $i++) array_walk(@array_filter($regions, function ($x) use ($i) { return $i & $x; var_dump($x, $i); }), function ($x, $region) use (&$list) { if (isset($list[$region])) $list[$region] .= ",$x"; else $list[$region] = $x; } ); var_dump($list);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 3
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 3
Branch analysis from position: 22
Branch analysis from position: 3
filename:       /in/goF4n
function name:  (null)
number of ops:  26
compiled vars:  !0 = $regions, !1 = $i, !2 = $list
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   12     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->18
   13     3    >   INIT_FCALL                                               'array_walk'
          4        BEGIN_SILENCE                                    ~5      
          5        INIT_FCALL                                               'array_filter'
          6        SEND_VAR                                                 !0
          7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FgoF4n%3A13%240'
          8        BIND_LEXICAL                                             ~6, !1
          9        SEND_VAL                                                 ~6
         10        DO_ICALL                                         $7      
         11        END_SILENCE                                              ~5
         12        SEND_VAR_NO_REF                               0          $7
   14    13        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FgoF4n%3A14%241'
         14        BIND_LEXICAL                                             ~8, !2
         15        SEND_VAL                                                 ~8
         16        DO_ICALL                                                 
   12    17        PRE_INC                                                  !1
         18    >   COUNT                                            ~11     !0
         19        SL                                               ~12     1, ~11
         20        IS_SMALLER                                               !1, ~12
         21      > JMPNZ                                                    ~13, ->3
   17    22    >   INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FgoF4n%3A13%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/goF4n
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $x, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        BW_AND                                           ~2      !1, !0
          3      > RETURN                                                   ~2
          4*       INIT_FCALL                                               'var_dump'
          5*       SEND_VAR                                                 !0
          6*       SEND_VAR                                                 !1
          7*       DO_ICALL                                                 
          8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FgoF4n%3A13%240

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

End of function %00%7Bclosure%7D%2Fin%2FgoF4n%3A14%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.93 ms | 1400 KiB | 19 Q