3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait T { abstract static function values(): array; } class A { use T; static function values() { return 'Worked!'; } } echo A::values(); // print: Worked! abstract class B { use T; } class C extends B { static function values() { return 'Don\'t worked'; } } echo C::values();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/38lmA
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'a'
   14     1        INIT_STATIC_METHOD_CALL                                  'A', 'values'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   16     4        DECLARE_CLASS                                            'b'
   20     5        DECLARE_CLASS                                            'c', 'b'
   26     6        INIT_STATIC_METHOD_CALL                                  'C', 'values'
          7        DO_FCALL                                      0  $1      
          8        ECHO                                                     $1
          9      > RETURN                                                   1

Class T:
Function values:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/38lmA
function name:  values
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 values

End of class T.

Class A:
Function values:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/38lmA
function name:  values
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E > > RETURN                                                   'Worked%21'
   11     1*     > RETURN                                                   null

End of function values

End of class A.

Class B: [no user functions]
Class C:
Function values:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/38lmA
function name:  values
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E > > RETURN                                                   'Don%27t+worked'
   23     1*     > RETURN                                                   null

End of function values

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
185.5 ms | 1448 KiB | 13 Q