3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class A { public function getName() { return '42'; } } class B extends A {} echo (new A)->getName(); echo (new B)->getName();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YSpRr
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $0      'A'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'getName'
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
   12     5        NEW                                              $3      'B'
          6        DO_FCALL                                      0          
          7        INIT_METHOD_CALL                                         $3, 'getName'
          8        DO_FCALL                                      0  $5      
          9        ECHO                                                     $5
         10      > RETURN                                                   1

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

End of function getname

End of class A.

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

End of function getname

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.36 ms | 1394 KiB | 13 Q