3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A{ const TYPE = 'A'; public function getType(){ return self::TYPE; } } class B extends A{ const TYPE = 'B'; } print_r((new B)->getType());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6k7g6
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'print_r'
          1        NEW                                              $0      'B'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'getType'
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

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

End of function gettype

End of class A.

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

End of function gettype

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.65 ms | 1395 KiB | 15 Q