3v4l.org

run code in 300+ PHP versions simultaneously
<?php #[Attribute] class SomeAttr {} #[SomeAttr] class SomeClass { /** * Some comment */ #[SomeAttr] public function someMethod(string $someParam): void { } } $reflection = new ReflectionClass(SomeClass::class); echo (string) $reflection; echo (string) $reflection->getMethod('someMethod'); echo $reflection->getMethod('someMethod')->getAttributes()[0];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ht9pi
function name:  (null)
number of ops:  19
compiled vars:  !0 = $reflection
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'ReflectionClass'
          1        SEND_VAL_EX                                              'SomeClass'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   19     4        CAST                                          6  ~4      !0
          5        ECHO                                                     ~4
   21     6        INIT_METHOD_CALL                                         !0, 'getMethod'
          7        SEND_VAL_EX                                              'someMethod'
          8        DO_FCALL                                      0  $5      
          9        CAST                                          6  ~6      $5
         10        ECHO                                                     ~6
   23    11        INIT_METHOD_CALL                                         !0, 'getMethod'
         12        SEND_VAL_EX                                              'someMethod'
         13        DO_FCALL                                      0  $7      
         14        INIT_METHOD_CALL                                         $7, 'getAttributes'
         15        DO_FCALL                                      0  $8      
         16        FETCH_DIM_R                                      ~9      $8, 0
         17        ECHO                                                     ~9
         18      > RETURN                                                   1

Class SomeAttr: [no user functions]
Class SomeClass:
Function somemethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ht9pi
function name:  someMethod
number of ops:  2
compiled vars:  !0 = $someParam
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   15     1      > RETURN                                                   null

End of function somemethod

End of class SomeClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.52 ms | 995 KiB | 13 Q