3v4l.org

run code in 500+ PHP versions simultaneously
<?php interface FooInterface { public function bar(): FooInterface; } class Foo implements FooInterface { public function bar(): static { return $this; } } class Qux extends Foo { public function bar(): FooInterface { return $this; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J04NA
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   DECLARE_CLASS                                                'foo'
   17     1        DECLARE_CLASS                                                'qux', 'foo'
   23     2      > RETURN                                                       1

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

End of function bar

End of class FooInterface.

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J04NA
function name:  bar
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   FETCH_THIS                                           ~0      
          1        VERIFY_RETURN_TYPE                                           ~0
          2      > RETURN                                                       ~0
   14     3*       VERIFY_RETURN_TYPE                                           
          4*     > RETURN                                                       null

End of function bar

End of class Foo.

Class Qux:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J04NA
function name:  bar
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   FETCH_THIS                                           ~0      
          1        VERIFY_RETURN_TYPE                                           ~0
          2      > RETURN                                                       ~0
   22     3*       VERIFY_RETURN_TYPE                                           
          4*     > RETURN                                                       null

End of function bar

End of class Qux.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.13 ms | 1491 KiB | 13 Q