3v4l.org

run code in 500+ PHP versions simultaneously
<?php interface Contract { const PASSWORD_RESET = 'passwords.reset'; public function reset(): void; } class A implements Contract { public function reset(): void { echo static::PASSWORD_RESET, "\n"; } } class B extends A { const PASSWORD_RESET = 'foobar'; } (new A())->reset(); (new B())->reset();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YjLvn
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   DECLARE_CLASS                                                'a'
   18     1        DECLARE_CLASS                                                'b', 'a'
   22     2        NEW                                                  $0      'A'
          3        DO_FCALL                                          0          
          4        INIT_METHOD_CALL                                             $0, 'reset'
          5        DO_FCALL                                          0          
   23     6        NEW                                                  $3      'B'
          7        DO_FCALL                                          0          
          8        INIT_METHOD_CALL                                             $3, 'reset'
          9        DO_FCALL                                          0          
         10      > RETURN                                                       1

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

End of function reset

End of class Contract.

Class A:
Function reset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YjLvn
function name:  reset
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   FETCH_CLASS_CONSTANT                                 ~0      'PASSWORD_RESET'
          1        ECHO                                                         ~0
          2        ECHO                                                         '%0A'
   15     3      > RETURN                                                       null

End of function reset

End of class A.

Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
337.98 ms | 3321 KiB | 14 Q