3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Chicken { public static function x() { echo "Turducken"; } } trait Turkey { public static function x() { Chicken::x(); } } class Duck { use Turkey; } $duck = new Duck(); $duck->x(); Chicken::x();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M88Ba
function name:  (null)
number of ops:  9
compiled vars:  !0 = $duck
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   DECLARE_CLASS                                            'duck'
   25     1        NEW                                              $1      'Duck'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   26     4        INIT_METHOD_CALL                                         !0, 'x'
          5        DO_FCALL                                      0          
   28     6        INIT_STATIC_METHOD_CALL                                  'Chicken', 'x'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

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

End of function x

End of class Chicken.

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

End of function x

End of class Turkey.

Class Duck: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.82 ms | 1394 KiB | 13 Q