3v4l.org

run code in 300+ PHP versions simultaneously
<?php #[\Attribute(\Attribute::TARGET_PROPERTY)] final class AutowireProperty {} class A { #[AutowireProperty] protected string $foo; } class B extends A { } $fooA = new \ReflectionProperty(A::class, 'foo'); $fooB = new \ReflectionProperty(B::class, 'foo'); echo "Class A: "; var_export($fooA->getAttributes()[0]->getName()); echo "\n"; echo "Class B: "; var_export($fooA->getAttributes()[0]->getName()); echo "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WYsXd
function name:  (null)
number of ops:  31
compiled vars:  !0 = $fooA, !1 = $fooB
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $2      'ReflectionProperty'
          1        SEND_VAL_EX                                              'A'
          2        SEND_VAL_EX                                              'foo'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   15     5        NEW                                              $5      'ReflectionProperty'
          6        SEND_VAL_EX                                              'B'
          7        SEND_VAL_EX                                              'foo'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $5
   17    10        ECHO                                                     'Class+A%3A+'
   18    11        INIT_FCALL                                               'var_export'
         12        INIT_METHOD_CALL                                         !0, 'getAttributes'
         13        DO_FCALL                                      0  $8      
         14        FETCH_DIM_R                                      ~9      $8, 0
         15        INIT_METHOD_CALL                                         ~9, 'getName'
         16        DO_FCALL                                      0  $10     
         17        SEND_VAR                                                 $10
         18        DO_ICALL                                                 
   19    19        ECHO                                                     '%0A'
   21    20        ECHO                                                     'Class+B%3A+'
   22    21        INIT_FCALL                                               'var_export'
         22        INIT_METHOD_CALL                                         !0, 'getAttributes'
         23        DO_FCALL                                      0  $12     
         24        FETCH_DIM_R                                      ~13     $12, 0
         25        INIT_METHOD_CALL                                         ~13, 'getName'
         26        DO_FCALL                                      0  $14     
         27        SEND_VAR                                                 $14
         28        DO_ICALL                                                 
   23    29        ECHO                                                     '%0A'
         30      > RETURN                                                   1

Class AutowireProperty: [no user functions]
Class A: [no user functions]
Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.8 ms | 1452 KiB | 14 Q