3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function foo(): Bar { //some ops return $bar; //'Bar' object } } class B extends A { public function foo(): BarX { //some ops return $barX; //'BarX' object } } phpinfo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/54VD0
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   DECLARE_CLASS                                            'b', 'a'
   17     1        INIT_FCALL                                               'phpinfo'
          2        DO_ICALL                                                 
          3      > RETURN                                                   1

Class A:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/54VD0
function name:  foo
number of ops:  4
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   VERIFY_RETURN_TYPE                                       !0
          1      > RETURN                                                   !0
    7     2*       VERIFY_RETURN_TYPE                                       
          3*     > RETURN                                                   null

End of function foo

End of class A.

Class B:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/54VD0
function name:  foo
number of ops:  4
compiled vars:  !0 = $barX
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   VERIFY_RETURN_TYPE                                       !0
          1      > RETURN                                                   !0
   14     2*       VERIFY_RETURN_TYPE                                       
          3*     > RETURN                                                   null

End of function foo

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.84 ms | 1395 KiB | 15 Q