3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface classThing { public function getClass(); public function setClass($class); } class Something implements classThing { private $class; public function setClass($class) { $this->class = $class; } public function getClass() { return $this->class; } } $header = array(new Something); if ($header[0] instanceof classThing && (($class = $header[0]->getClass()) !== false)) { echo $class; } else { echo 'not set'; } $header[0]->setClass('bla'); if ($header[0] instanceof classThing && (($class = $header[0]->getClass()) !== false)) { echo $class; } else { echo 'not set'; } $header[0]->setClass(false); if ($header[0] instanceof classThing && (($class = $header[0]->getClass()) !== false)) { echo $class; } else { echo 'not set'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 46) Position 1 = 25, Position 2 = 31
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 34
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 46) Position 1 = 42, Position 2 = 48
Branch analysis from position: 42
2 jumps found. (Code = 43) Position 1 = 49, Position 2 = 51
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 48
Branch analysis from position: 34
2 jumps found. (Code = 46) Position 1 = 42, Position 2 = 48
Branch analysis from position: 42
Branch analysis from position: 48
Branch analysis from position: 31
Branch analysis from position: 17
2 jumps found. (Code = 46) Position 1 = 25, Position 2 = 31
Branch analysis from position: 25
Branch analysis from position: 31
Branch analysis from position: 14
filename:       /in/gJtuq
function name:  (null)
number of ops:  53
compiled vars:  !0 = $header, !1 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   DECLARE_CLASS                                            'something'
   12     1        NEW                                              $2      'Something'
          2        DO_FCALL                                      0          
          3        INIT_ARRAY                                       ~4      $2
          4        ASSIGN                                                   !0, ~4
   14     5        FETCH_DIM_R                                      ~6      !0, 0
          6        INSTANCEOF                                       ~7      ~6, 'classThing'
          7      > JMPZ_EX                                          ~7      ~7, ->14
          8    >   FETCH_DIM_R                                      ~8      !0, 0
          9        INIT_METHOD_CALL                                         ~8, 'getClass'
         10        DO_FCALL                                      0  $9      
         11        ASSIGN                                           ~10     !1, $9
         12        TYPE_CHECK                                  1018  ~11     ~10
         13        BOOL                                             ~7      ~11
         14    > > JMPZ                                                     ~7, ->17
   15    15    >   ECHO                                                     !1
         16      > JMP                                                      ->18
   18    17    >   ECHO                                                     'not+set'
   21    18    >   FETCH_DIM_R                                      ~12     !0, 0
         19        INIT_METHOD_CALL                                         ~12, 'setClass'
         20        SEND_VAL_EX                                              'bla'
         21        DO_FCALL                                      0          
   23    22        FETCH_DIM_R                                      ~14     !0, 0
         23        INSTANCEOF                                       ~15     ~14, 'classThing'
         24      > JMPZ_EX                                          ~15     ~15, ->31
         25    >   FETCH_DIM_R                                      ~16     !0, 0
         26        INIT_METHOD_CALL                                         ~16, 'getClass'
         27        DO_FCALL                                      0  $17     
         28        ASSIGN                                           ~18     !1, $17
         29        TYPE_CHECK                                  1018  ~19     ~18
         30        BOOL                                             ~15     ~19
         31    > > JMPZ                                                     ~15, ->34
   24    32    >   ECHO                                                     !1
         33      > JMP                                                      ->35
   27    34    >   ECHO                                                     'not+set'
   30    35    >   FETCH_DIM_R                                      ~20     !0, 0
         36        INIT_METHOD_CALL                                         ~20, 'setClass'
         37        SEND_VAL_EX                                              <false>
         38        DO_FCALL                                      0          
   32    39        FETCH_DIM_R                                      ~22     !0, 0
         40        INSTANCEOF                                       ~23     ~22, 'classThing'
         41      > JMPZ_EX                                          ~23     ~23, ->48
         42    >   FETCH_DIM_R                                      ~24     !0, 0
         43        INIT_METHOD_CALL                                         ~24, 'getClass'
         44        DO_FCALL                                      0  $25     
         45        ASSIGN                                           ~26     !1, $25
         46        TYPE_CHECK                                  1018  ~27     ~26
         47        BOOL                                             ~23     ~27
         48    > > JMPZ                                                     ~23, ->51
   33    49    >   ECHO                                                     !1
         50      > JMP                                                      ->52
   36    51    >   ECHO                                                     'not+set'
   37    52    > > RETURN                                                   1

Class classThing:
Function getclass:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gJtuq
function name:  getClass
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E > > RETURN                                                   null

End of function getclass

Function setclass:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gJtuq
function name:  setClass
number of ops:  2
compiled vars:  !0 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function setclass

End of class classThing.

Class Something:
Function setclass:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gJtuq
function name:  setClass
number of ops:  4
compiled vars:  !0 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        ASSIGN_OBJ                                               'class'
          2        OP_DATA                                                  !0
          3      > RETURN                                                   null

End of function setclass

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

End of function getclass

End of class Something.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.58 ms | 1403 KiB | 13 Q