3v4l.org

run code in 500+ PHP versions simultaneously
<?php interface StreamInterface { public function __toString(): string; public function foo(): string; } class X implements StreamInterface { public function __toString() { return 'x'; } public function foo(): string { // fatal error with line below // public function foo() { return 'x'; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XfgXZ
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                                'streaminterface'
   10     1        DECLARE_CLASS                                                'x'
   20     2      > RETURN                                                       1

Class StreamInterface:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XfgXZ
function name:  __toString
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   VERIFY_RETURN_TYPE                                           
          1      > RETURN                                                       null

End of function __tostring

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

End of function foo

End of class StreamInterface.

Class X:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XfgXZ
function name:  __toString
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E > > RETURN                                                       'x'
   14     1*       VERIFY_RETURN_TYPE                                           
          2*     > RETURN                                                       null

End of function __tostring

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XfgXZ
function name:  foo
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E > > RETURN                                                       'x'
   19     1*       VERIFY_RETURN_TYPE                                           
          2*     > RETURN                                                       null

End of function foo

End of class X.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
128.1 ms | 475 KiB | 7 Q