3v4l.org

run code in 500+ PHP versions simultaneously
<?php # this shows the error when using self as a return type in an # interface on PHP 7.3 – the same works fine in 7.4+ interface NodeInterface {} interface SuggestionContextInterface { public function buildForIndex(NodeInterface $node): self; } class SuggestionContext implements SuggestionContextInterface { public function buildForIndex(NodeInterface $node): self { return $this; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lWsh2
function name:  (null)
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   DECLARE_CLASS                                                'suggestioncontext'
   19     1      > RETURN                                                       1

Class NodeInterface: [no user functions]
Class SuggestionContextInterface:
Function buildforindex:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lWsh2
function name:  buildForIndex
number of ops:  3
compiled vars:  !0 = $node
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
          1        VERIFY_RETURN_TYPE                                           
          2      > RETURN                                                       null

End of function buildforindex

End of class SuggestionContextInterface.

Class SuggestionContext:
Function buildforindex:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lWsh2
function name:  buildForIndex
number of ops:  6
compiled vars:  !0 = $node
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   RECV                                                 !0      
   17     1        FETCH_THIS                                           ~1      
          2        VERIFY_RETURN_TYPE                                           ~1
          3      > RETURN                                                       ~1
   18     4*       VERIFY_RETURN_TYPE                                           
          5*     > RETURN                                                       null

End of function buildforindex

End of class SuggestionContext.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.76 ms | 1934 KiB | 13 Q