3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait T { abstract function foo(): string; } abstract class A { use T; } /* class B extends A { // This fatals as expected function foo() { return 'some string'; } } */ class C { use T; // This does not function foo() { return 'some string'; } } class D { use T; // This ALSO does not function foo(): int { return 3; } } abstract class E { use T; // Nor this function foo() { return 'some thing'; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AVSXN
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'a'
   20     1        DECLARE_CLASS                                            'c'
   29     2        DECLARE_CLASS                                            'd'
   38     3        DECLARE_CLASS                                            'e'
   45     4      > RETURN                                                   1

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

End of function foo

End of class T.

Class A: [no user functions]
Class C:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AVSXN
function name:  foo
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E > > RETURN                                                   'some+string'
   26     1*     > RETURN                                                   null

End of function foo

End of class C.

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

End of function foo

End of class D.

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

End of function foo

End of class E.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.4 ms | 940 KiB | 14 Q