3v4l.org

run code in 500+ PHP versions simultaneously
<?php abstract class A { private function foo() { print __CLASS__; } } abstract class B extends A { public function foo() { print __CLASS__; } } class C extends B { public function foo() { print __CLASS__; } public function goo() { parent::foo(); a::foo(); } } ($c = new C)->foo(); $c->goo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pXCpG
function name:  (null)
number of ops:  8
compiled vars:  !0 = $c
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   26     0  E >   NEW                                                  $1      'C'
          1        DO_FCALL                                          0          
          2        ASSIGN                                               ~3      !0, $1
          3        INIT_METHOD_CALL                                             ~3, 'foo'
          4        DO_FCALL                                          0          
   27     5        INIT_METHOD_CALL                                             !0, 'goo'
          6        DO_FCALL                                          0          
          7      > RETURN                                                       1

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

End of function foo

End of class A.

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

End of function foo

End of class B.

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

End of function foo

Function goo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pXCpG
function name:  goo
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   INIT_STATIC_METHOD_CALL                                      'foo'
          1        DO_FCALL                                          0          
   22     2        INIT_STATIC_METHOD_CALL                                      'a', 'foo'
          3        DO_FCALL                                          0          
   23     4      > RETURN                                                       null

End of function goo

End of class C.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.8 ms | 1143 KiB | 13 Q