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; if ($is_god) { print "This player is god\n"; } print "$class_name\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 67, Position 2 = 68
Branch analysis from position: 67
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 68
filename:       /in/kP2Wd
function name:  (null)
number of ops:  72
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                                                 
    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                                   ~24     'CLASS_MASK'
         56        BW_AND                                           ~25     !0, ~24
         57        ASSIGN                                                   !2, ~25
   27    58        FETCH_CONSTANT                                   ~27     'WARRIOR_OFFSET'
         59        SR                                               ~28     !2, ~27
         60        ASSIGN                                                   !2, ~28
   29    61        FETCH_DIM_R                                      ~30     !1, !2
         62        ASSIGN                                                   !3, ~30
   30    63        FETCH_CONSTANT                                   ~32     'CF_GOD'
         64        BW_AND                                           ~33     !0, ~32
         65        ASSIGN                                                   !4, ~33
   31    66      > JMPZ                                                     !4, ->68
         67    >   ECHO                                                     'This+player+is+god%0A'
   32    68    >   NOP                                                      
         69        FAST_CONCAT                                      ~35     !3, '%0A'
         70        ECHO                                                     ~35
         71      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.32 ms | 1400 KiB | 15 Q