3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace foo { trait A { function x() { var_dump(self::class); } } } 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(); } main(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3vhT9
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   DECLARE_CLASS                                            'b'
    9     1        DECLARE_CLASS                                            'c'
   10     2        DECLARE_CLASS                                            'd', 'c'
   18     3        INIT_FCALL                                               'main'
          4        DO_FCALL                                      0          
   19     5      > RETURN                                                   1

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