3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface classThing { public function getClass(); public function setClass(); } 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) { echo $header[0]->getClass(); } else { echo 'not set'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ngnq9
function name:  (null)
number of ops:  15
compiled vars:  !0 = $header
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   DECLARE_CLASS                                            'something'
   12     1        NEW                                              $1      'Something'
          2        DO_FCALL                                      0          
          3        INIT_ARRAY                                       ~3      $1
          4        ASSIGN                                                   !0, ~3
   14     5        FETCH_DIM_R                                      ~5      !0, 0
          6        INSTANCEOF                                               ~5, 'classThing'
          7      > JMPZ                                                     ~6, ->13
   15     8    >   FETCH_DIM_R                                      ~7      !0, 0
          9        INIT_METHOD_CALL                                         ~7, 'getClass'
         10        DO_FCALL                                      0  $8      
         11        ECHO                                                     $8
         12      > JMP                                                      ->14
   18    13    >   ECHO                                                     'not+set'
   19    14    > > RETURN                                                   1

Class classThing:
Function getclass:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ngnq9
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/Ngnq9
function name:  setClass
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > 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/Ngnq9
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/Ngnq9
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:
187.99 ms | 1399 KiB | 13 Q