3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace foo { trait A { function x() { var_dump(self::class); } } class Q { use \foo\A; } class R extends Q {} } namespace { class B { use \foo\A; } class C { use \foo\A; } class D extends C {} function main() { (new B)->x(); (new C)->x(); (new D)->x(); (new Q)->x(); (new R)->x(); } main(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/boZBh
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_CLASS                                            'foo%5Cq'
    6     1        DECLARE_CLASS                                            'foo%5Cr', 'foo%5Cq'
   10     2        DECLARE_CLASS                                            'b'
   11     3        DECLARE_CLASS                                            'c'
   12     4        DECLARE_CLASS                                            'd', 'c'
   22     5        INIT_FCALL                                               'main'
          6        DO_FCALL                                      0          
   23     7      > RETURN                                                   1

Function main:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/boZBh
function name:  main
number of ops:  21
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $0      'B'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'x'
          3        DO_FCALL                                      0          
   16     4        NEW                                              $3      'C'
          5        DO_FCALL                                      0          
          6        INIT_METHOD_CALL                                         $3, 'x'
          7        DO_FCALL                                      0          
   17     8        NEW                                              $6      'D'
          9        DO_FCALL                                      0          
         10        INIT_METHOD_CALL                                         $6, 'x'
         11        DO_FCALL                                      0          
   18    12        NEW                                              $9      'Q'
         13        DO_FCALL                                      0          
         14        INIT_METHOD_CALL                                         $9, 'x'
         15        DO_FCALL                                      0          
   19    16        NEW                                              $12     'R'
         17        DO_FCALL                                      0          
         18        INIT_METHOD_CALL                                         $12, 'x'
         19        DO_FCALL                                      0          
   20    20      > RETURN                                                   null

End of function main

Class foo\A:
Function x:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/boZBh
function name:  x
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_NS_FCALL_BY_NAME                                    'foo%5Cvar_dump'
          1        FETCH_CLASS_NAME                                 ~0      
          2        SEND_VAL_EX                                              ~0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   null

End of function x

End of class foo\A.

Class foo\Q: [no user functions]
Class foo\R: [no user functions]
Class B: [no user functions]
Class C: [no user functions]
Class D: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.78 ms | 1399 KiB | 16 Q