3v4l.org

run code in 300+ PHP versions simultaneously
<?php class EnumShit { const SHOW_TEST = 1; // 2 ^ 0 const SHOW_DERP = 2; // 2 ^ 1 const SHOW_FOO = 4; // 2 ^ 2 public function __construct($type) { switch ($type) { case self::SHOW_DERP: echo "Showing derp!\n"; break; case self::SHOW_TEST: echo "Showing Test!\n"; break; case self::SHOW_FOO: echo "Showing Test!\n"; break; case self::SHOW_DERP | self::SHOW_TEST: echo "Showing both DERP and TEST!\n"; break; case self::SHOW_FOO | self::SHOW_TEST: echo "Showing both FOO and TEST!\n"; break; case self::SHOW_DERP | self::SHOW_FOO: echo "Showing both DERP and FOO!\n"; break; case self::SHOW_DERP | self::SHOW_TEST | self::SHOW_FOO: echo "Showing ALL!\n"; break; } } } // Foo and Test new EnumShit(EnumShit::SHOW_TEST | EnumShit::SHOW_FOO);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iToR4
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   44     0  E >   NEW                                              $0      'EnumShit'
          1        SEND_VAL_EX                                              5
          2        DO_FCALL                                      0          
          3        FREE                                                     $0
          4      > RETURN                                                   1

Class EnumShit:
Function __construct:
Finding entry points
Branch analysis from position: 0
9 jumps found. (Code = 187) Position 1 = 17, Position 2 = 19, Position 3 = 21, Position 4 = 23, Position 5 = 25, Position 6 = 27, Position 7 = 29, Position 8 = 31, Position 9 = 2
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 31
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 19
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 21
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 23
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 25
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 27
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 29
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 29
Branch analysis from position: 27
Branch analysis from position: 25
Branch analysis from position: 23
Branch analysis from position: 21
Branch analysis from position: 19
Branch analysis from position: 17
filename:       /in/iToR4
function name:  __construct
number of ops:  32
compiled vars:  !0 = $type
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1      > SWITCH_LONG                                              !0, [ 2:->17, 1:->19, 4:->21, 3:->23, 5:->25, 6:->27, 7:->29, ], ->31
          2    >   IS_EQUAL                                                 !0, 2
          3      > JMPNZ                                                    ~1, ->17
          4    >   IS_EQUAL                                                 !0, 1
          5      > JMPNZ                                                    ~1, ->19
          6    >   IS_EQUAL                                                 !0, 4
          7      > JMPNZ                                                    ~1, ->21
          8    >   IS_EQUAL                                                 !0, 3
          9      > JMPNZ                                                    ~1, ->23
         10    >   IS_EQUAL                                                 !0, 5
         11      > JMPNZ                                                    ~1, ->25
         12    >   IS_EQUAL                                                 !0, 6
         13      > JMPNZ                                                    ~1, ->27
         14    >   IS_EQUAL                                                 !0, 7
         15      > JMPNZ                                                    ~1, ->29
         16    > > JMP                                                      ->31
   11    17    >   ECHO                                                     'Showing+derp%21%0A'
   12    18      > JMP                                                      ->31
   15    19    >   ECHO                                                     'Showing+Test%21%0A'
   16    20      > JMP                                                      ->31
   19    21    >   ECHO                                                     'Showing+Test%21%0A'
   20    22      > JMP                                                      ->31
   23    23    >   ECHO                                                     'Showing+both+DERP+and+TEST%21%0A'
   24    24      > JMP                                                      ->31
   27    25    >   ECHO                                                     'Showing+both+FOO+and+TEST%21%0A'
   28    26      > JMP                                                      ->31
   32    27    >   ECHO                                                     'Showing+both+DERP+and+FOO%21%0A'
   33    28      > JMP                                                      ->31
   37    29    >   ECHO                                                     'Showing+ALL%21%0A'
   38    30      > JMP                                                      ->31
   40    31    > > RETURN                                                   null

End of function __construct

End of class EnumShit.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.72 ms | 1390 KiB | 13 Q