3v4l.org

run code in 500+ PHP versions simultaneously
<?php abstract class A { public 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(); } } ($c = new C)->foo(); echo "\n"; $c->goo(); echo "\n....drum roll...\n"; (new class extends A {})->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GGTeV
function name:  (null)
number of ops:  15
compiled vars:  !0 = $c
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   25     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        ECHO                                                         '%0A'
   29     6        INIT_METHOD_CALL                                             !0, 'goo'
          7        DO_FCALL                                          0          
   31     8        ECHO                                                         '%0A....drum+roll...%0A'
   33     9        DECLARE_ANON_CLASS                                   <unknown> 'a'
         10        NEW                                                  $7      $6
         11        DO_FCALL                                          0          
         12        INIT_METHOD_CALL                                             $7, 'foo'
         13        DO_FCALL                                          0          
         14      > RETURN                                                       1

Class A:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GGTeV
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/GGTeV
function name:  foo
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   ECHO                                                         'B'
   13     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/GGTeV
function name:  foo
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   ECHO                                                         'C'
   19     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/GGTeV
function name:  goo
number of ops:  3
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      > RETURN                                                       null

End of function goo

End of class C.

Class A@anonymous: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
126.32 ms | 479 KiB | 7 Q