3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ModeSwitcher { const MODE_ALL_MEMBERS = 0b1; const MODE_SINGLE_MEMBER = 0b01; const MODE_ALL_TYPES = 0b001; const MODE_SINGLE_TYPE = 0b0001; private $mode; public function __construct() { $this->mode = static::MODE_ALL_MEMBERS | static::MODE_SINGLE_MEMBER; } function isMode($mode) { return ($this->mode && $mode) > 0; } } $a = new ModeSwitcher(); var_dump($a->isMode(ModeSwitcher::MODE_ALL_TYPES));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s6uh7
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'ModeSwitcher'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   25     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'isMode'
          5        SEND_VAL_EX                                              1
          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/s6uh7
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
2 jumps found. (Code = 46) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
filename:       /in/s6uh7
function name:  isMode
number of ops:  7
compiled vars:  !0 = $mode
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1        FETCH_OBJ_R                                      ~1      'mode'
          2      > JMPZ_EX                                          ~1      ~1, ->4
          3    >   BOOL                                             ~1      !0
          4    >   IS_SMALLER                                       ~2      0, ~1
          5      > RETURN                                                   ~2
   20     6*     > RETURN                                                   null

End of function ismode

End of class ModeSwitcher.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.63 ms | 1396 KiB | 15 Q