3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface FooInterface {} class A implements FooInterface {} class B implements FooInterface {} interface DoX { public function run(): FooInterface; } class Imp implements DoX { /** * @return \A|\B */ public function run() { return new A(); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4QVaj
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   DECLARE_CLASS                                            'a'
    5     1        DECLARE_CLASS                                            'b'
   12     2        DECLARE_CLASS                                            'imp'
   21     3      > RETURN                                                   1

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

End of function run

End of class DoX.

Class Imp:
Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4QVaj
function name:  run
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $0      'A'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
   20     3*     > RETURN                                                   null

End of function run

End of class Imp.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.58 ms | 1010 KiB | 13 Q