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()) { echo $class; } else { echo 'not set'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/s9WIh
function name:  (null)
number of ops:  18
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, ->13
          8    >   FETCH_DIM_R                                      ~8      !0, 0
          9        INIT_METHOD_CALL                                         ~8, 'getClass'
         10        DO_FCALL                                      0  $9      
         11        ASSIGN                                           ~10     !1, $9
         12        BOOL                                             ~7      ~10
         13    > > JMPZ                                                     ~7, ->16
   15    14    >   ECHO                                                     !1
         15      > JMP                                                      ->17
   18    16    >   ECHO                                                     'not+set'
   19    17    > > RETURN                                                   1

Class classThing:
Function getclass:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s9WIh
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/s9WIh
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/s9WIh
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/s9WIh
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:
140.09 ms | 1399 KiB | 13 Q