3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ModeSwitcher { const MODE_ALL_MEMBERS = 0b1; const MODE_SINGLE_MEMBER = 0b10; const MODE_ALL_TYPES = 0b100; const MODE_SINGLE_TYPE = 0b1000; private $mode; public function __construct() { $this->mode = static::MODE_ALL_MEMBERS | static::MODE_SINGLE_MEMBER; } function isMode($mode) { var_dump($this->mode, $mode, $this->mode & $mode); return ($this->mode & $mode) > 0; } } $a = new ModeSwitcher(); var_dump($a->isMode(ModeSwitcher::MODE_SINGLE_MEMBER));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hvgtF
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'ModeSwitcher'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   26     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'isMode'
          5        SEND_VAL_EX                                              2
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Class ModeSwitcher:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hvgtF
function name:  __construct
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_CLASS_CONSTANT                             ~1      'MODE_ALL_MEMBERS'
          1        FETCH_CLASS_CONSTANT                             ~2      'MODE_SINGLE_MEMBER'
          2        BW_OR                                            ~3      ~1, ~2
          3        ASSIGN_OBJ                                               'mode'
          4        OP_DATA                                                  ~3
   15     5      > RETURN                                                   null

End of function __construct

Function ismode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hvgtF
function name:  isMode
number of ops:  14
compiled vars:  !0 = $mode
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1        INIT_FCALL                                               'var_dump'
          2        FETCH_OBJ_R                                      ~1      'mode'
          3        SEND_VAL                                                 ~1
          4        SEND_VAR                                                 !0
          5        FETCH_OBJ_R                                      ~2      'mode'
          6        BW_AND                                           ~3      !0, ~2
          7        SEND_VAL                                                 ~3
          8        DO_ICALL                                                 
   20     9        FETCH_OBJ_R                                      ~5      'mode'
         10        BW_AND                                           ~6      !0, ~5
         11        IS_SMALLER                                       ~7      0, ~6
         12      > RETURN                                                   ~7
   21    13*     > RETURN                                                   null

End of function ismode

End of class ModeSwitcher.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.52 ms | 1388 KiB | 15 Q