3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function foo(): ?Exception { return new Exception('foo'); } } class B extends A { public function foo(): Exception { return null; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ogotc
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E > > RETURN                                                   1

Class A:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ogotc
function name:  foo
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $0      'Exception'
          1        SEND_VAL_EX                                              'foo'
          2        DO_FCALL                                      0          
          3        VERIFY_RETURN_TYPE                                       $0
          4      > RETURN                                                   $0
    8     5*       VERIFY_RETURN_TYPE                                       
          6*     > 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/ogotc
function name:  foo
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   VERIFY_RETURN_TYPE                               ~0      null
          1      > RETURN                                                   ~0
   16     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:
172.96 ms | 1393 KiB | 13 Q