3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * BAR */ class Bar { /** * BAR::$prop */ protected $prop; /** * BAR::method() */ protected function method() { } } /** * FOO */ class Foo extends Bar { /** * FOO::$prop */ protected $prop; /** * FOO::method() */ protected function method() { } } echo "Class:\n"; $reflectionClass = new \ReflectionClass('Foo'); var_dump($reflectionClass->getDocComment()); $reflectionClass = new \ReflectionClass('Bar'); var_dump($reflectionClass->getDocComment()); echo "Property:\n"; $reflectionClass = new \ReflectionProperty('Foo', 'prop'); var_dump($reflectionClass->getDocComment()); $reflectionClass = new \ReflectionProperty('Bar', 'prop'); var_dump($reflectionClass->getDocComment()); echo "Method:\n"; $reflectionClass = new \ReflectionMethod('Foo', 'method'); var_dump($reflectionClass->getDocComment()); $reflectionClass = new \ReflectionMethod('Bar', 'method'); var_dump($reflectionClass->getDocComment());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6fRdn
function name:  (null)
number of ops:  62
compiled vars:  !0 = $reflectionClass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E >   ECHO                                                     'Class%3A%0A'
   40     1        NEW                                              $1      'ReflectionClass'
          2        SEND_VAL_EX                                              'Foo'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   41     5        INIT_FCALL                                               'var_dump'
          6        INIT_METHOD_CALL                                         !0, 'getDocComment'
          7        DO_FCALL                                      0  $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
   42    10        NEW                                              $6      'ReflectionClass'
         11        SEND_VAL_EX                                              'Bar'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !0, $6
   43    14        INIT_FCALL                                               'var_dump'
         15        INIT_METHOD_CALL                                         !0, 'getDocComment'
         16        DO_FCALL                                      0  $9      
         17        SEND_VAR                                                 $9
         18        DO_ICALL                                                 
   45    19        ECHO                                                     'Property%3A%0A'
   46    20        NEW                                              $11     'ReflectionProperty'
         21        SEND_VAL_EX                                              'Foo'
         22        SEND_VAL_EX                                              'prop'
         23        DO_FCALL                                      0          
         24        ASSIGN                                                   !0, $11
   47    25        INIT_FCALL                                               'var_dump'
         26        INIT_METHOD_CALL                                         !0, 'getDocComment'
         27        DO_FCALL                                      0  $14     
         28        SEND_VAR                                                 $14
         29        DO_ICALL                                                 
   48    30        NEW                                              $16     'ReflectionProperty'
         31        SEND_VAL_EX                                              'Bar'
         32        SEND_VAL_EX                                              'prop'
         33        DO_FCALL                                      0          
         34        ASSIGN                                                   !0, $16
   49    35        INIT_FCALL                                               'var_dump'
         36        INIT_METHOD_CALL                                         !0, 'getDocComment'
         37        DO_FCALL                                      0  $19     
         38        SEND_VAR                                                 $19
         39        DO_ICALL                                                 
   51    40        ECHO                                                     'Method%3A%0A'
   52    41        NEW                                              $21     'ReflectionMethod'
         42        SEND_VAL_EX                                              'Foo'
         43        SEND_VAL_EX                                              'method'
         44        DO_FCALL                                      0          
         45        ASSIGN                                                   !0, $21
   53    46        INIT_FCALL                                               'var_dump'
         47        INIT_METHOD_CALL                                         !0, 'getDocComment'
         48        DO_FCALL                                      0  $24     
         49        SEND_VAR                                                 $24
         50        DO_ICALL                                                 
   54    51        NEW                                              $26     'ReflectionMethod'
         52        SEND_VAL_EX                                              'Bar'
         53        SEND_VAL_EX                                              'method'
         54        DO_FCALL                                      0          
         55        ASSIGN                                                   !0, $26
   55    56        INIT_FCALL                                               'var_dump'
         57        INIT_METHOD_CALL                                         !0, 'getDocComment'
         58        DO_FCALL                                      0  $29     
         59        SEND_VAR                                                 $29
         60        DO_ICALL                                                 
         61      > RETURN                                                   1

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

End of function method

End of class Bar.

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

End of function method

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.11 ms | 1003 KiB | 14 Q