3v4l.org

run code in 300+ PHP versions simultaneously
<?php $depth = 0; spl_autoload_register(function ($class) use (&$depth) { $depth++; $indent = str_repeat('| ', $depth); echo $indent."$depth: $class\n"; if ($class == 'IFace') { interface IFace {} } elseif ($class == 'IFaceImplementor') { class IFaceImplementor implements IFace {} } elseif ($class == 'InterfaceOfMainParent') { interface InterfaceOfMainParent { public function methodForSecondaryLspCheck(): IFace; } } elseif ($class == 'MainParent') { abstract class MainParent implements InterfaceOfMainParent { public function methodForSecondaryLspCheck(): IFaceImplementor {} } } elseif ($class == 'Intermediate') { abstract class Intermediate extends MainParent {} } elseif ($class == 'Child1') { class Child1 extends Intermediate {} } elseif ($class == 'Child2') { class Child2 extends Intermediate {} } elseif ($class == 'EntrypointParent') { abstract class EntrypointParent { abstract public function methodForLspCheck1(): MainParent; abstract public function methodForLspCheck2(): MainParent; } } elseif ($class == 'Entrypoint') { class Entrypoint extends EntrypointParent { public function methodForLspCheck1(): Child1 {} public function methodForLspCheck2(): Child2 {} } } $depth--; }); class_exists(Entrypoint::class);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G5fFe
function name:  (null)
number of ops:  10
compiled vars:  !0 = $depth
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, 0
    7     1        INIT_FCALL                                               'spl_autoload_register'
          2        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          3        BIND_LEXICAL                                             ~2, !0
   47     4        SEND_VAL                                                 ~2
    7     5        DO_ICALL                                                 
   49     6        INIT_FCALL                                               'class_exists'
          7        SEND_VAL                                                 'Entrypoint'
          8        DO_ICALL                                                 
          9      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 30
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 34
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 38
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
Branch analysis from position: 38
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 42
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
Branch analysis from position: 42
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 46
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
Branch analysis from position: 46
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 49
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
filename:       /in/G5fFe
function name:  {closure}
number of ops:  51
compiled vars:  !0 = $class, !1 = $depth, !2 = $indent
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
    8     2        PRE_INC                                                  !1
    9     3        INIT_FCALL                                               'str_repeat'
          4        SEND_VAL                                                 '%7C+'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $4      
          7        ASSIGN                                                   !2, $4
   10     8        ROPE_INIT                                     4  ~7      !1
          9        ROPE_ADD                                      1  ~7      ~7, '%3A+'
         10        ROPE_ADD                                      2  ~7      ~7, !0
         11        ROPE_END                                      3  ~6      ~7, '%0A'
         12        CONCAT                                           ~9      !2, ~6
         13        ECHO                                                     ~9
   12    14        IS_EQUAL                                                 !0, 'IFace'
         15      > JMPZ                                                     ~10, ->18
   13    16    >   DECLARE_CLASS                                            'iface'
   12    17      > JMP                                                      ->49
   14    18    >   IS_EQUAL                                                 !0, 'IFaceImplementor'
         19      > JMPZ                                                     ~11, ->22
   15    20    >   DECLARE_CLASS                                            'ifaceimplementor'
   14    21      > JMP                                                      ->49
   16    22    >   IS_EQUAL                                                 !0, 'InterfaceOfMainParent'
         23      > JMPZ                                                     ~12, ->26
   17    24    >   DECLARE_CLASS                                            'interfaceofmainparent'
   16    25      > JMP                                                      ->49
   21    26    >   IS_EQUAL                                                 !0, 'MainParent'
         27      > JMPZ                                                     ~13, ->30
   22    28    >   DECLARE_CLASS                                            'mainparent'
   21    29      > JMP                                                      ->49
   26    30    >   IS_EQUAL                                                 !0, 'Intermediate'
         31      > JMPZ                                                     ~14, ->34
   27    32    >   DECLARE_CLASS                                            'intermediate', 'mainparent'
   26    33      > JMP                                                      ->49
   28    34    >   IS_EQUAL                                                 !0, 'Child1'
         35      > JMPZ                                                     ~15, ->38
   29    36    >   DECLARE_CLASS                                            'child1', 'intermediate'
   28    37      > JMP                                                      ->49
   30    38    >   IS_EQUAL                                                 !0, 'Child2'
         39      > JMPZ                                                     ~16, ->42
   31    40    >   DECLARE_CLASS                                            'child2', 'intermediate'
   30    41      > JMP                                                      ->49
   32    42    >   IS_EQUAL                                                 !0, 'EntrypointParent'
         43      > JMPZ                                                     ~17, ->46
   33    44    >   DECLARE_CLASS                                            'entrypointparent'
   32    45      > JMP                                                      ->49
   38    46    >   IS_EQUAL                                                 !0, 'Entrypoint'
         47      > JMPZ                                                     ~18, ->49
   39    48    >   DECLARE_CLASS                                            'entrypoint', 'entrypointparent'
   46    49    >   PRE_DEC                                                  !1
   47    50      > RETURN                                                   null

End of Dynamic Function 0

Class IFace: [no user functions]
Class IFaceImplementor: [no user functions]
Class InterfaceOfMainParent:
Function methodforsecondarylspcheck:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G5fFe
function name:  methodForSecondaryLspCheck
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   VERIFY_RETURN_TYPE                                       
          1      > RETURN                                                   null

End of function methodforsecondarylspcheck

End of class InterfaceOfMainParent.

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

End of function methodforsecondarylspcheck

End of class MainParent.

Class Intermediate: [no user functions]
Class Child1: [no user functions]
Class Child2: [no user functions]
Class EntrypointParent:
Function methodforlspcheck1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G5fFe
function name:  methodForLspCheck1
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   VERIFY_RETURN_TYPE                                       
          1      > RETURN                                                   null

End of function methodforlspcheck1

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

End of function methodforlspcheck2

End of class EntrypointParent.

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

End of function methodforlspcheck1

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

End of function methodforlspcheck2

End of class Entrypoint.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.29 ms | 1011 KiB | 16 Q