3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait MyTrait { /** * Comes from trait */ private $foo; } class MyClass { use MyTrait; /** * Comes from class */ private $foo; } $classFoo = new \ReflectionProperty('MyClass', 'foo'); $traitFoo = new \ReflectionProperty('MyTrait', 'foo'); var_export($traitFoo->getDocComment() == $classFoo->getDocComment());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uJA3s
function name:  (null)
number of ops:  20
compiled vars:  !0 = $classFoo, !1 = $traitFoo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_CLASS                                            'myclass'
   21     1        NEW                                              $2      'ReflectionProperty'
          2        SEND_VAL_EX                                              'MyClass'
          3        SEND_VAL_EX                                              'foo'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
   22     6        NEW                                              $5      'ReflectionProperty'
          7        SEND_VAL_EX                                              'MyTrait'
          8        SEND_VAL_EX                                              'foo'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $5
   24    11        INIT_FCALL                                               'var_export'
         12        INIT_METHOD_CALL                                         !1, 'getDocComment'
         13        DO_FCALL                                      0  $8      
         14        INIT_METHOD_CALL                                         !0, 'getDocComment'
         15        DO_FCALL                                      0  $9      
         16        IS_EQUAL                                         ~10     $8, $9
         17        SEND_VAL                                                 ~10
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Class MyTrait: [no user functions]
Class MyClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.52 ms | 997 KiB | 14 Q