3v4l.org

run code in 500+ PHP versions simultaneously
<?php trait t { function as() { echo 'as'; } } class x { use t { as as as ;} } (new x)->as(); // prints as
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SN2hX
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   DECLARE_CLASS                                                'x'
   12     1        NEW                                                  $0      'x'
          2        DO_FCALL                                          0          
          3        INIT_METHOD_CALL                                             $0, 'as'
          4        DO_FCALL                                          0          
   13     5      > RETURN                                                       1

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

End of function as

End of class t.

Class x: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
174.54 ms | 1460 KiB | 13 Q