3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Field { const READ = 1; const WRITE = 2; private $name; private $readWriteMask; public function __construct($name, $readWriteMask = null) { $this->name = (string) $name; $this->readWriteMask = $readWriteMask ?: self::READ; } public function getName() { return $this->name; } public function isReadable() { return ($this->readWriteMask & self::READ); } public function isWritable() { return (boolean) $this->readWriteMask & self::WRITE; } } $a = new Field('a'); var_dump($a->isReadable()); var_dump($a->isWritable());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vZAHN
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   NEW                                              $1      'Field'
          1        SEND_VAL_EX                                              'a'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   31     4        INIT_FCALL                                               'var_dump'
          5        INIT_METHOD_CALL                                         !0, 'isReadable'
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
   32     9        INIT_FCALL                                               'var_dump'
         10        INIT_METHOD_CALL                                         !0, 'isWritable'
         11        DO_FCALL                                      0  $6      
         12        SEND_VAR                                                 $6
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class Field:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vZAHN
function name:  __construct
number of ops:  10
compiled vars:  !0 = $name, !1 = $readWriteMask
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
   12     2        CAST                                          6  ~3      !0
          3        ASSIGN_OBJ                                               'name'
          4        OP_DATA                                                  ~3
   13     5        JMP_SET                                          ~5      !1, ->7
          6        QM_ASSIGN                                        ~5      1
          7        ASSIGN_OBJ                                               'readWriteMask'
          8        OP_DATA                                                  ~5
   14     9      > RETURN                                                   null

End of function __construct

Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vZAHN
function name:  getName
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_OBJ_R                                      ~0      'name'
          1      > RETURN                                                   ~0
   18     2*     > RETURN                                                   null

End of function getname

Function isreadable:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vZAHN
function name:  isReadable
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   FETCH_OBJ_R                                      ~0      'readWriteMask'
          1        BW_AND                                           ~1      ~0, 1
          2      > RETURN                                                   ~1
   22     3*     > RETURN                                                   null

End of function isreadable

Function iswritable:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vZAHN
function name:  isWritable
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   FETCH_OBJ_R                                      ~0      'readWriteMask'
          1        BOOL                                             ~1      ~0
          2        BW_AND                                           ~2      ~1, 2
          3      > RETURN                                                   ~2
   26     4*     > RETURN                                                   null

End of function iswritable

End of class Field.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.12 ms | 1400 KiB | 15 Q