3v4l.org

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

Class A: [no user functions]
Class B: [no user functions]
Class C: [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/21fYt
function name:  foo
number of ops:  2
compiled vars:  !0 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1      > 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/21fYt
function name:  foo
number of ops:  2
compiled vars:  !0 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function foo

End of class AbstractTest.

Class TestInterfaceContravariance:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/21fYt
function name:  foo
number of ops:  2
compiled vars:  !0 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
          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/21fYt
function name:  foo
number of ops:  2
compiled vars:  !0 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function foo

End of class TestInterfaceCovariance.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.3 ms | 1395 KiB | 13 Q