3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Define the Interface interface MyInterface { public function MyFunction(); } // Define the class implementation of the interface class MyClass implements MyInterface { public function MyFunction() { return "MyClass Implements MyInterface!"; } } // Instantiate the object $my_object = new MyClass; if (is_subclass_of('MyClass', 'MyInterface')) { echo "Yes, MyClass is a subclass of MyInterface\n"; } else { echo "No, MyClass is not a subclass of MyInterface\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FvhNP
function name:  (null)
number of ops:  13
compiled vars:  !0 = $my_object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   DECLARE_CLASS                                            'myclass'
   19     1        NEW                                              $1      'MyClass'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   21     4        INIT_FCALL                                               'is_subclass_of'
          5        SEND_VAL                                                 'MyClass'
          6        SEND_VAL                                                 'MyInterface'
          7        DO_ICALL                                         $4      
          8      > JMPZ                                                     $4, ->11
   22     9    >   ECHO                                                     'Yes%2C+MyClass+is+a+subclass+of+MyInterface%0A'
         10      > JMP                                                      ->12
   24    11    >   ECHO                                                     'No%2C+MyClass+is+not+a+subclass+of+MyInterface%0A'
   25    12    > > RETURN                                                   1

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

End of function myfunction

End of class MyInterface.

Class MyClass:
Function myfunction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FvhNP
function name:  MyFunction
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E > > RETURN                                                   'MyClass+Implements+MyInterface%21'
   15     1*     > RETURN                                                   null

End of function myfunction

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.32 ms | 1400 KiB | 15 Q