3v4l.org

run code in 300+ PHP versions simultaneously
<?php $decimal= 0x8000000; const FLAG_1 = 0x1b; const FLAG_2 = 0x2; const FLAG_3 = 0x4; const FLAG_4 = 0x8; const FLAG_5 = 0x10; const FLAG_6 = 0x20; const FLAG_7 = 0x40; const FLAG_8 = 0x80; const FLAG_9 = 0x100; const FLAG_10 = 0x200; const FLAG_11 = 0x400; const FLAG_12 = 0x800; function show_flags ($decimal) { if ($decimal & FLAG_1) { echo "Flag 1 included.<br>\n"; } if ($decimal & FLAG_2) { echo "Flag 2 included.<br>\n"; } if ($decimal & FLAG_3) { echo "Flag 3 included.<br>\n"; } if ($decimal & FLAG_4) { echo "Flag 4 included.<br>\n"; } if ($decimal & FLAG_5) { echo "Flag 5 included.<br>\n"; } if ($decimal & FLAG_6) { echo "Flag 6 included.<br>\n"; } if ($decimal & FLAG_7) { echo "Flag 7 included.<br>\n"; } if ($decimal & FLAG_8) { echo "Flag 8 included.<br>\n"; } if ($decimal & FLAG_9) { echo "Flag 9 included.<br>\n"; } if ($decimal & FLAG_10) { echo "Flag 10 included.<br>\n"; } if ($decimal & FLAG_11) { echo "Flag 11 included.<br>\n"; } if ($decimal & FLAG_12) { echo "Flag 12 included.<br>\n"; } } show_flags($decimal);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TG2sg
function name:  (null)
number of ops:  17
compiled vars:  !0 = $decimal
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 134217728
    5     1        DECLARE_CONST                                            'FLAG_1', 27
    6     2        DECLARE_CONST                                            'FLAG_2', 2
    7     3        DECLARE_CONST                                            'FLAG_3', 4
    8     4        DECLARE_CONST                                            'FLAG_4', 8
    9     5        DECLARE_CONST                                            'FLAG_5', 16
   10     6        DECLARE_CONST                                            'FLAG_6', 32
   11     7        DECLARE_CONST                                            'FLAG_7', 64
   12     8        DECLARE_CONST                                            'FLAG_8', 128
   13     9        DECLARE_CONST                                            'FLAG_9', 256
   14    10        DECLARE_CONST                                            'FLAG_10', 512
   15    11        DECLARE_CONST                                            'FLAG_11', 1024
   16    12        DECLARE_CONST                                            'FLAG_12', 2048
   57    13        INIT_FCALL                                               'show_flags'
         14        SEND_VAR                                                 !0
         15        DO_FCALL                                      0          
         16      > RETURN                                                   1

Function show_flags:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 17
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 21
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 25
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 29
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 33
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 37
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 41
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 45
Branch analysis from position: 44
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 49
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
Branch analysis from position: 45
Branch analysis from position: 41
Branch analysis from position: 37
Branch analysis from position: 33
Branch analysis from position: 29
Branch analysis from position: 25
Branch analysis from position: 21
Branch analysis from position: 17
Branch analysis from position: 13
Branch analysis from position: 9
Branch analysis from position: 5
filename:       /in/TG2sg
function name:  show_flags
number of ops:  50
compiled vars:  !0 = $decimal
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   19     1        FETCH_CONSTANT                                   ~1      'FLAG_1'
          2        BW_AND                                           ~2      !0, ~1
          3      > JMPZ                                                     ~2, ->5
   20     4    >   ECHO                                                     'Flag+1+included.%3Cbr%3E%0A'
   22     5    >   FETCH_CONSTANT                                   ~3      'FLAG_2'
          6        BW_AND                                           ~4      !0, ~3
          7      > JMPZ                                                     ~4, ->9
   23     8    >   ECHO                                                     'Flag+2+included.%3Cbr%3E%0A'
   25     9    >   FETCH_CONSTANT                                   ~5      'FLAG_3'
         10        BW_AND                                           ~6      !0, ~5
         11      > JMPZ                                                     ~6, ->13
   26    12    >   ECHO                                                     'Flag+3+included.%3Cbr%3E%0A'
   28    13    >   FETCH_CONSTANT                                   ~7      'FLAG_4'
         14        BW_AND                                           ~8      !0, ~7
         15      > JMPZ                                                     ~8, ->17
   29    16    >   ECHO                                                     'Flag+4+included.%3Cbr%3E%0A'
   31    17    >   FETCH_CONSTANT                                   ~9      'FLAG_5'
         18        BW_AND                                           ~10     !0, ~9
         19      > JMPZ                                                     ~10, ->21
   32    20    >   ECHO                                                     'Flag+5+included.%3Cbr%3E%0A'
   34    21    >   FETCH_CONSTANT                                   ~11     'FLAG_6'
         22        BW_AND                                           ~12     !0, ~11
         23      > JMPZ                                                     ~12, ->25
   35    24    >   ECHO                                                     'Flag+6+included.%3Cbr%3E%0A'
   37    25    >   FETCH_CONSTANT                                   ~13     'FLAG_7'
         26        BW_AND                                           ~14     !0, ~13
         27      > JMPZ                                                     ~14, ->29
   38    28    >   ECHO                                                     'Flag+7+included.%3Cbr%3E%0A'
   40    29    >   FETCH_CONSTANT                                   ~15     'FLAG_8'
         30        BW_AND                                           ~16     !0, ~15
         31      > JMPZ                                                     ~16, ->33
   41    32    >   ECHO                                                     'Flag+8+included.%3Cbr%3E%0A'
   43    33    >   FETCH_CONSTANT                                   ~17     'FLAG_9'
         34        BW_AND                                           ~18     !0, ~17
         35      > JMPZ                                                     ~18, ->37
   44    36    >   ECHO                                                     'Flag+9+included.%3Cbr%3E%0A'
   46    37    >   FETCH_CONSTANT                                   ~19     'FLAG_10'
         38        BW_AND                                           ~20     !0, ~19
         39      > JMPZ                                                     ~20, ->41
   47    40    >   ECHO                                                     'Flag+10+included.%3Cbr%3E%0A'
   49    41    >   FETCH_CONSTANT                                   ~21     'FLAG_11'
         42        BW_AND                                           ~22     !0, ~21
         43      > JMPZ                                                     ~22, ->45
   50    44    >   ECHO                                                     'Flag+11+included.%3Cbr%3E%0A'
   52    45    >   FETCH_CONSTANT                                   ~23     'FLAG_12'
         46        BW_AND                                           ~24     !0, ~23
         47      > JMPZ                                                     ~24, ->49
   53    48    >   ECHO                                                     'Flag+12+included.%3Cbr%3E%0A'
   55    49    > > RETURN                                                   null

End of function show_flags

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
214.29 ms | 1406 KiB | 14 Q