3v4l.org

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

Class Chicken:
Function x:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LasAm
function name:  x
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ECHO                                                     'x'
    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/LasAm
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:
142.6 ms | 1385 KiB | 13 Q