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 = $bitmask & CF_GOD; $is_arch = $bitmask & CF_ARCH; if ($is_god) { print "Godly "; } if ($is_arch) { print "Arch "; } print "$class_name\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 70, Position 2 = 71
Branch analysis from position: 70
2 jumps found. (Code = 43) Position 1 = 72, Position 2 = 73
Branch analysis from position: 72
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 73
Branch analysis from position: 71
filename:       /in/DVCsH
function name:  (null)
number of ops:  77
compiled vars:  !0 = $bitmask, !1 = $classMap, !2 = $class, !3 = $class_name, !4 = $is_god, !5 = $is_arch
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                                   ~8      'WARRIOR_OFFSET'
         11        SL                                               ~9      1, ~8
         12        FETCH_CONSTANT                                   ~10     'MAGE_OFFSET'
         13        SL                                               ~11     1, ~10
         14        BW_OR                                            ~12     ~9, ~11
         15        SEND_VAL                                                 ~12
         16        DO_ICALL                                                 
    6    17        INIT_FCALL                                               'define'
         18        SEND_VAL                                                 'CF_GOD'
         19        SEND_VAL                                                 4
         20        DO_ICALL                                                 
    7    21        INIT_FCALL                                               'define'
         22        SEND_VAL                                                 'CF_PLAYER'
         23        SEND_VAL                                                 8
         24        DO_ICALL                                                 
    8    25        INIT_FCALL                                               'define'
         26        SEND_VAL                                                 'CF_STAFF'
         27        SEND_VAL                                                 16
         28        DO_ICALL                                                 
    9    29        INIT_FCALL                                               'define'
         30        SEND_VAL                                                 'CF_INVISIBLE'
         31        SEND_VAL                                                 32
         32        DO_ICALL                                                 
   10    33        INIT_FCALL                                               'define'
         34        SEND_VAL                                                 'CF_GENDER'
         35        SEND_VAL                                                 49152
         36        DO_ICALL                                                 
   11    37        INIT_FCALL                                               'define'
         38        SEND_VAL                                                 'CF_ARCH'
         39        SEND_VAL                                                 262144
         40        DO_ICALL                                                 
   12    41        INIT_FCALL                                               'define'
         42        SEND_VAL                                                 'CF_LQMASTER'
         43        SEND_VAL                                                 4503599627370496
         44        DO_ICALL                                                 
   13    45        INIT_FCALL                                               'define'
         46        SEND_VAL                                                 'CF_NOWHO'
         47        SEND_VAL                                                 72057594037927936
         48        DO_ICALL                                                 
   14    49        INIT_FCALL                                               'define'
         50        SEND_VAL                                                 'CF_WON'
         51        SEND_VAL                                                 144115188075855872
         52        DO_ICALL                                                 
   16    53        ASSIGN                                                   !0, 475149
   18    54        ASSIGN                                                   !1, <array>
   25    55        FETCH_CONSTANT                                   ~25     'CLASS_MASK'
         56        BW_AND                                           ~26     !0, ~25
         57        ASSIGN                                                   !2, ~26
   27    58        FETCH_CONSTANT                                   ~28     'WARRIOR_OFFSET'
         59        SR                                               ~29     !2, ~28
         60        ASSIGN                                                   !2, ~29
   29    61        FETCH_DIM_R                                      ~31     !1, !2
         62        ASSIGN                                                   !3, ~31
   30    63        FETCH_CONSTANT                                   ~33     'CF_GOD'
         64        BW_AND                                           ~34     !0, ~33
         65        ASSIGN                                                   !4, ~34
   31    66        FETCH_CONSTANT                                   ~36     'CF_ARCH'
         67        BW_AND                                           ~37     !0, ~36
         68        ASSIGN                                                   !5, ~37
   32    69      > JMPZ                                                     !4, ->71
         70    >   ECHO                                                     'Godly+'
   33    71    > > JMPZ                                                     !5, ->73
         72    >   ECHO                                                     'Arch+'
   34    73    >   NOP                                                      
         74        FAST_CONCAT                                      ~39     !3, '%0A'
         75        ECHO                                                     ~39
         76      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.43 ms | 1400 KiB | 15 Q