3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait A { function sayHello() { print "hello"; } } class X { use A; } function useTrait(A $a) { $a->sayHello(); } useTrait(new X()); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0jADg
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   DECLARE_CLASS                                            'x'
   17     1        INIT_FCALL                                               'usetrait'
          2        NEW                                              $0      'X'
          3        DO_FCALL                                      0          
          4        SEND_VAR                                                 $0
          5        DO_FCALL                                      0          
   19     6      > RETURN                                                   1

Function usetrait:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0jADg
function name:  useTrait
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        INIT_METHOD_CALL                                         !0, 'sayHello'
          2        DO_FCALL                                      0          
   15     3      > RETURN                                                   null

End of function usetrait

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

End of function sayhello

End of class A.

Class X: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.6 ms | 1402 KiB | 14 Q