3v4l.org

run code in 300+ PHP versions simultaneously
<?php $decimal = 613090029426844e18; // doesn't work $decimal2 = 64; //works const FLAG_1 = 0x1; const FLAG_2 = 0x2; const FLAG_3 = 0x4; const FLAG_4 = 0x4; const FLAG_5 = 0x32; const FLAG_6 = 0x40; const FLAG_7 = 0x400; 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 3 included.<br>\n"; } if ($decimal & FLAG_5) { echo "Flag 3 included.<br>\n"; } if ($decimal & FLAG_6) { echo "Flag 3 included.<br>\n"; } if ($decimal & FLAG_7) { echo "Flag 3 included.<br>\n"; } } show_flags($decimal);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1gGIq
function name:  (null)
number of ops:  13
compiled vars:  !0 = $decimal, !1 = $decimal2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 6.1309e+32
    4     1        ASSIGN                                                   !1, 64
    6     2        DECLARE_CONST                                            'FLAG_1', 1
    7     3        DECLARE_CONST                                            'FLAG_2', 2
    8     4        DECLARE_CONST                                            'FLAG_3', 4
    9     5        DECLARE_CONST                                            'FLAG_4', 4
   10     6        DECLARE_CONST                                            'FLAG_5', 50
   11     7        DECLARE_CONST                                            'FLAG_6', 64
   12     8        DECLARE_CONST                                            'FLAG_7', 1024
   38     9        INIT_FCALL                                               'show_flags'
         10        SEND_VAR                                                 !0
         11        DO_FCALL                                      0          
         12      > 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
1 jumps found. (Code = 62) Position 1 = -2
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/1gGIq
function name:  show_flags
number of ops:  30
compiled vars:  !0 = $decimal
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        FETCH_CONSTANT                                   ~1      'FLAG_1'
          2        BW_AND                                           ~2      !0, ~1
          3      > JMPZ                                                     ~2, ->5
   16     4    >   ECHO                                                     'Flag+1+included.%3Cbr%3E%0A'
   18     5    >   FETCH_CONSTANT                                   ~3      'FLAG_2'
          6        BW_AND                                           ~4      !0, ~3
          7      > JMPZ                                                     ~4, ->9
   19     8    >   ECHO                                                     'Flag+2+included.%3Cbr%3E%0A'
   21     9    >   FETCH_CONSTANT                                   ~5      'FLAG_3'
         10        BW_AND                                           ~6      !0, ~5
         11      > JMPZ                                                     ~6, ->13
   22    12    >   ECHO                                                     'Flag+3+included.%3Cbr%3E%0A'
   24    13    >   FETCH_CONSTANT                                   ~7      'FLAG_4'
         14        BW_AND                                           ~8      !0, ~7
         15      > JMPZ                                                     ~8, ->17
   25    16    >   ECHO                                                     'Flag+3+included.%3Cbr%3E%0A'
   27    17    >   FETCH_CONSTANT                                   ~9      'FLAG_5'
         18        BW_AND                                           ~10     !0, ~9
         19      > JMPZ                                                     ~10, ->21
   28    20    >   ECHO                                                     'Flag+3+included.%3Cbr%3E%0A'
   30    21    >   FETCH_CONSTANT                                   ~11     'FLAG_6'
         22        BW_AND                                           ~12     !0, ~11
         23      > JMPZ                                                     ~12, ->25
   31    24    >   ECHO                                                     'Flag+3+included.%3Cbr%3E%0A'
   33    25    >   FETCH_CONSTANT                                   ~13     'FLAG_7'
         26        BW_AND                                           ~14     !0, ~13
         27      > JMPZ                                                     ~14, ->29
   34    28    >   ECHO                                                     'Flag+3+included.%3Cbr%3E%0A'
   36    29    > > RETURN                                                   null

End of function show_flags

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.9 ms | 1003 KiB | 14 Q