3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class A {} class B extends A {} class C extends B {} class D {} interface InterfaceTest { public function foo(); } abstract class AbstractTest { public abstract function foo(); } class TestAbstractContravariance extends AbstractTest { public function foo(): D {} } class TestAbstractCovariance extends AbstractTest { public function foo(): D {} } class TestInterfaceContravariance implements InterfaceTest { public function foo(): D {} } class TestInterfaceCovariance implements InterfaceTest { public function foo(): D {} }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B22nE
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   DECLARE_CLASS                                            'testinterfacecontravariance'
   25     1        DECLARE_CLASS                                            'testinterfacecovariance'
   27     2      > RETURN                                                   1

Class A: [no user functions]
Class B: [no user functions]
Class C: [no user functions]
Class D: [no user functions]
Class InterfaceTest:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B22nE
function name:  foo
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E > > RETURN                                                   null

End of function foo

End of class InterfaceTest.

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

End of function foo

End of class AbstractTest.

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

End of function foo

End of class TestAbstractContravariance.

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

End of function foo

End of class TestAbstractCovariance.

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

End of function foo

End of class TestInterfaceContravariance.

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

End of function foo

End of class TestInterfaceCovariance.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.82 ms | 1399 KiB | 13 Q