3v4l.org

run code in 500+ PHP versions simultaneously
<?php class ParentClassWithToStringMixedReturn { public function __toString() { return 'a'; } } class WithParentMixedReturn extends ParentClassWithToStringMixedReturn { public function __toString(): string { return 'value'; } } echo (new WithParentMixedReturn());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IrE2q
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                                'parentclasswithtostringmixedreturn'
   11     1        DECLARE_CLASS                                                'withparentmixedreturn', 'parentclasswithtostringmixedreturn'
   19     2        NEW                                                  $0      'WithParentMixedReturn'
          3        DO_FCALL                                          0          
          4        ECHO                                                         $0
          5      > RETURN                                                       1

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

End of function __tostring

End of class ParentClassWithToStringMixedReturn.

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

End of function __tostring

End of class WithParentMixedReturn.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.84 ms | 1315 KiB | 13 Q