3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Base { function func() { echo " Base"; } function parent() { echo " None"; } } class Extended extends Base { function Func() { echo " Extended"; } function Parent() { echo parent::func(); } } class Extended2 extends Extended { function func() { echo " Extended2"; } function parent() { echo parent::Func(); } function grandpa() { echo parent::parent(); } } $var1 = new Base(); $var2 = new Extended(); $var3 = new Extended2(); $var1->func(); $var2->func(); $var3->func(); $var2->parent(); $var3->parent(); $var3->grandpa();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MS5Ko
function name:  (null)
number of ops:  22
compiled vars:  !0 = $var1, !1 = $var2, !2 = $var3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E >   NEW                                              $3      'Base'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   40     3        NEW                                              $6      'Extended'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $6
   41     6        NEW                                              $9      'Extended2'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !2, $9
   43     9        INIT_METHOD_CALL                                         !0, 'func'
         10        DO_FCALL                                      0          
   44    11        INIT_METHOD_CALL                                         !1, 'func'
         12        DO_FCALL                                      0          
   45    13        INIT_METHOD_CALL                                         !2, 'func'
         14        DO_FCALL                                      0          
   46    15        INIT_METHOD_CALL                                         !1, 'parent'
         16        DO_FCALL                                      0          
   47    17        INIT_METHOD_CALL                                         !2, 'parent'
         18        DO_FCALL                                      0          
   48    19        INIT_METHOD_CALL                                         !2, 'grandpa'
         20        DO_FCALL                                      0          
         21      > RETURN                                                   1

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

End of function func

Function parent:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MS5Ko
function name:  parent
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                     '+None'
   10     1      > RETURN                                                   null

End of function parent

End of class Base.

Class Extended:
Function func:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MS5Ko
function name:  Func
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ECHO                                                     '+Extended'
   17     1      > RETURN                                                   null

End of function func

Function parent:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MS5Ko
function name:  Parent
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_STATIC_METHOD_CALL                                  'func'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
   21     3      > RETURN                                                   null

End of function parent

End of class Extended.

Class Extended2:
Function func:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MS5Ko
function name:  func
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   ECHO                                                     '+Extended2'
   28     1      > RETURN                                                   null

End of function func

Function parent:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MS5Ko
function name:  parent
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   INIT_STATIC_METHOD_CALL                                  'Func'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
   32     3      > RETURN                                                   null

End of function parent

Function grandpa:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MS5Ko
function name:  grandpa
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   INIT_STATIC_METHOD_CALL                                  'parent'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
   36     3      > RETURN                                                   null

End of function grandpa

End of class Extended2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154 ms | 1399 KiB | 13 Q