3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait T1 { public function __construct(){ echo "t1 trait"; parent::__construct(); } } trait T2 { public function __construct(){ echo "t2 trait"; parent::__construct(); } } class Test { use T1, T2; public function __construct(){ echo "test class"; } } $t = new Test(); var_dump(ReflectionClass::getTraitNames($t));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tFQr1
function name:  (null)
number of ops:  11
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   DECLARE_CLASS                                            'test'
   31     1        NEW                                              $1      'Test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   32     4        INIT_FCALL                                               'var_dump'
          5        INIT_STATIC_METHOD_CALL                                  'ReflectionClass', 'getTraitNames'
          6        SEND_VAR                                                 !0
          7        DO_FCALL                                      0  $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Class T1:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tFQr1
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ECHO                                                     't1+trait'
    7     1        INIT_STATIC_METHOD_CALL                                  
          2        DO_FCALL                                      0          
    8     3      > RETURN                                                   null

End of function __construct

End of class T1.

Class T2:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tFQr1
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ECHO                                                     't2+trait'
   16     1        INIT_STATIC_METHOD_CALL                                  
          2        DO_FCALL                                      0          
   17     3      > RETURN                                                   null

End of function __construct

End of class T2.

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

End of function __construct

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.74 ms | 1396 KiB | 15 Q