3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('WARRIOR_OFFSET', 16); define('MAGE_OFFSET', 17); define('CLASS_MASK', ( 1 << WARRIOR_OFFSET ) | ( 1 << MAGE_OFFSET )); define('CF_GOD', 1 << 2); // may issue #god commands define('CF_PLAYER', 1 << 3); // is a player define('CF_STAFF', 1 << 4); // member of the staff define('CF_INVISIBLE', 1 << 5); // character is completely invisible define('CF_GENDER', 1 << 14 | 1 << 15); // Determine Gender define('CF_ARCH', 1 << 18); // is arch-XXX define('CF_LQMASTER', 1 << 52); // may host LQs define('CF_NOWHO', 1 << 56); // invisible to /who define('CF_WON', 1 << 57); // character won the game (ie killed islena $bitmask = 475149; $classMap = array( 0b00 => 'error', 0b01 => 'warrior', 0b10 => 'mage', 0b11 => 'seyan', ); $class = $bitmask & CLASS_MASK; $class = $class >> WARRIOR_OFFSET; $class_name = $classMap[$class]; $is_god = (bool) $bitmask & CF_GOD; print "$class_name\n"; print "$is_god";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BrgUO
function name:  (null)
number of ops:  73
compiled vars:  !0 = $bitmask, !1 = $classMap, !2 = $class, !3 = $class_name, !4 = $is_god
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'WARRIOR_OFFSET'
          2        SEND_VAL                                                 16
          3        DO_ICALL                                                 
    4     4        INIT_FCALL                                               'define'
          5        SEND_VAL                                                 'MAGE_OFFSET'
          6        SEND_VAL                                                 17
          7        DO_ICALL                                                 
    5     8        INIT_FCALL                                               'define'
          9        SEND_VAL                                                 'CLASS_MASK'
         10        FETCH_CONSTANT                                   ~7      'WARRIOR_OFFSET'
         11        SL                                               ~8      1, ~7
         12        FETCH_CONSTANT                                   ~9      'MAGE_OFFSET'
         13        SL                                               ~10     1, ~9
         14        BW_OR                                            ~11     ~8, ~10
         15        SEND_VAL                                                 ~11
         16        DO_ICALL                                                 
    8    17        INIT_FCALL                                               'define'
         18        SEND_VAL                                                 'CF_GOD'
         19        SEND_VAL                                                 4
         20        DO_ICALL                                                 
    9    21        INIT_FCALL                                               'define'
         22        SEND_VAL                                                 'CF_PLAYER'
         23        SEND_VAL                                                 8
         24        DO_ICALL                                                 
   10    25        INIT_FCALL                                               'define'
         26        SEND_VAL                                                 'CF_STAFF'
         27        SEND_VAL                                                 16
         28        DO_ICALL                                                 
   11    29        INIT_FCALL                                               'define'
         30        SEND_VAL                                                 'CF_INVISIBLE'
         31        SEND_VAL                                                 32
         32        DO_ICALL                                                 
   12    33        INIT_FCALL                                               'define'
         34        SEND_VAL                                                 'CF_GENDER'
         35        SEND_VAL                                                 49152
         36        DO_ICALL                                                 
   13    37        INIT_FCALL                                               'define'
         38        SEND_VAL                                                 'CF_ARCH'
         39        SEND_VAL                                                 262144
         40        DO_ICALL                                                 
   14    41        INIT_FCALL                                               'define'
         42        SEND_VAL                                                 'CF_LQMASTER'
         43        SEND_VAL                                                 4503599627370496
         44        DO_ICALL                                                 
   15    45        INIT_FCALL                                               'define'
         46        SEND_VAL                                                 'CF_NOWHO'
         47        SEND_VAL                                                 72057594037927936
         48        DO_ICALL                                                 
   16    49        INIT_FCALL                                               'define'
         50        SEND_VAL                                                 'CF_WON'
         51        SEND_VAL                                                 144115188075855872
         52        DO_ICALL                                                 
   18    53        ASSIGN                                                   !0, 475149
   20    54        ASSIGN                                                   !1, <array>
   27    55        FETCH_CONSTANT                                   ~24     'CLASS_MASK'
         56        BW_AND                                           ~25     !0, ~24
         57        ASSIGN                                                   !2, ~25
   29    58        FETCH_CONSTANT                                   ~27     'WARRIOR_OFFSET'
         59        SR                                               ~28     !2, ~27
         60        ASSIGN                                                   !2, ~28
   31    61        FETCH_DIM_R                                      ~30     !1, !2
         62        ASSIGN                                                   !3, ~30
   33    63        BOOL                                             ~32     !0
         64        FETCH_CONSTANT                                   ~33     'CF_GOD'
         65        BW_AND                                           ~34     ~32, ~33
         66        ASSIGN                                                   !4, ~34
   35    67        NOP                                                      
         68        FAST_CONCAT                                      ~36     !3, '%0A'
         69        ECHO                                                     ~36
   36    70        CAST                                          6  ~37     !4
         71        ECHO                                                     ~37
         72      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.78 ms | 1400 KiB | 15 Q