3v4l.org

run code in 500+ PHP versions simultaneously
<?php interface I{} class Data implements I{} abstract class P { public function getThing(): ?I { return null; } } class C extends P { public function getThing(): Data { return new Data; } } var_dump((new C)->getThing());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hdscV
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   DECLARE_CLASS                                                'data'
   14     1        DECLARE_CLASS                                                'c', 'p'
   21     2        INIT_FCALL                                                   'var_dump'
          3        NEW                                                  $0      'C'
          4        DO_FCALL                                          0          
          5        INIT_METHOD_CALL                                             $0, 'getThing'
          6        DO_FCALL                                          0  $2      
          7        SEND_VAR                                                     $2
          8        DO_ICALL                                                     
          9      > RETURN                                                       1

Class I: [no user functions]
Class Data: [no user functions]
Class P:
Function getthing:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hdscV
function name:  getThing
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E > > RETURN                                                       null
   11     1*       VERIFY_RETURN_TYPE                                           
          2*     > RETURN                                                       null

End of function getthing

End of class P.

Class C:
Function getthing:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hdscV
function name:  getThing
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   NEW                                                  $0      'Data'
          1        DO_FCALL                                          0          
          2        VERIFY_RETURN_TYPE                                           $0
          3      > RETURN                                                       $0
   18     4*       VERIFY_RETURN_TYPE                                           
          5*     > RETURN                                                       null

End of function getthing

End of class C.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.07 ms | 1710 KiB | 14 Q