3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { /** * Correct docblock */ public function bar( /** wrong dockblock */ $arg ) { } } $reflection = new ReflectionClass(Foo::class); echo $reflection->getMethod('bar')->getDocComment();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tR6i5
function name:  (null)
number of ops:  11
compiled vars:  !0 = $reflection
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'ReflectionClass'
          1        SEND_VAL_EX                                              'Foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   17     4        INIT_METHOD_CALL                                         !0, 'getMethod'
          5        SEND_VAL_EX                                              'bar'
          6        DO_FCALL                                      0  $4      
          7        INIT_METHOD_CALL                                         $4, 'getDocComment'
          8        DO_FCALL                                      0  $5      
          9        ECHO                                                     $5
         10      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tR6i5
function name:  bar
number of ops:  2
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
   12     1      > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.29 ms | 1393 KiB | 13 Q