3v4l.org

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

End of function somemethod

End of class SomeClass.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
174.13 ms | 2131 KiB | 13 Q