3v4l.org

run code in 200+ php & hhvm versions
<?php class A {} class B extends A{} class C extends B{} $b = 'B'; var_dump(is_subclass_of('A', 'A'), is_subclass_of('B', 'A'), is_subclass_of($b, 'A')); var_dump(is_a('A', 'A', true), is_a('B', 'A', true), is_a($b, 'A', true)); $className = 'C'; while($_parentClass = get_parent_class($className)) $parentClass = $_parentClass; var_dump($className, $parentClass);
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 46
Branch analysis from position: 46
Jump found. Position 1 = 51, Position 2 = 45
Branch analysis from position: 51
Jump found. Position 1 = -2
Branch analysis from position: 45
Jump found. Position 1 = 51, Position 2 = 45
Branch analysis from position: 51
Branch analysis from position: 45
filename:       /in/sSXjc
function name:  (null)
number of ops:  56
compiled vars:  !0 = $b, !1 = $className, !2 = $parentClass, !3 = $_parentClass
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
   4     1        NOP                                                      
         2        NOP                                                      
   5     3        NOP                                                      
         4        NOP                                                      
   7     5        ASSIGN                                                   !0, 'B'
   8     6        INIT_FCALL                                               'var_dump'
         7        INIT_FCALL                                               'is_subclass_of'
         8        SEND_VAL                                                 'A'
         9        SEND_VAL                                                 'A'
        10        DO_ICALL                                         $10     
        11        SEND_VAR                                                 $10
        12        INIT_FCALL                                               'is_subclass_of'
        13        SEND_VAL                                                 'B'
        14        SEND_VAL                                                 'A'
        15        DO_ICALL                                         $11     
        16        SEND_VAR                                                 $11
        17        INIT_FCALL                                               'is_subclass_of'
        18        SEND_VAR                                                 !0
        19        SEND_VAL                                                 'A'
        20        DO_ICALL                                         $12     
        21        SEND_VAR                                                 $12
        22        DO_ICALL                                                 
   9    23        INIT_FCALL                                               'var_dump'
        24        INIT_FCALL                                               'is_a'
        25        SEND_VAL                                                 'A'
        26        SEND_VAL                                                 'A'
        27        SEND_VAL                                                 <true>
        28        DO_ICALL                                         $14     
        29        SEND_VAR                                                 $14
        30        INIT_FCALL                                               'is_a'
        31        SEND_VAL                                                 'B'
        32        SEND_VAL                                                 'A'
        33        SEND_VAL                                                 <true>
        34        DO_ICALL                                         $15     
        35        SEND_VAR                                                 $15
        36        INIT_FCALL                                               'is_a'
        37        SEND_VAR                                                 !0
        38        SEND_VAL                                                 'A'
        39        SEND_VAL                                                 <true>
        40        DO_ICALL                                         $16     
        41        SEND_VAR                                                 $16
        42        DO_ICALL                                                 
  11    43        ASSIGN                                                   !1, 'C'
  13    44      > JMP                                                      ->46
  14    45    >   ASSIGN                                                   !2, !3
  13    46    >   INIT_FCALL                                               'get_parent_class'
        47        SEND_VAR                                                 !1
        48        DO_ICALL                                         $20     
        49        ASSIGN                                           $21     !3, $20
        50      > JMPNZ                                                    $21, ->45
  16    51    >   INIT_FCALL                                               'var_dump'
        52        SEND_VAR                                                 !1
        53        SEND_VAR                                                 !2
        54        DO_ICALL                                                 
        55      > RETURN                                                   1

Class A: [no user functions]
Class B: [no user functions]
Class C: [no user functions]

Generated using Vulcan Logic Dumper, using php 7.3.0