3v4l.org

run code in 300+ PHP versions simultaneously
<?php #[Attribute] class ParentAttribute { } class ParentClass { #[ParentAttribute] protected $foo; } #[Attribute] class ChildAttribute { } class ChildClass extends ParentClass { #[ChildAttribute] protected $foo; } $rp = new ReflectionProperty(ChildClass::class, "foo"); foreach ($rp->getAttributes() as $attribute) { print_r($attribute->getName()); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/nEML3
function name:  (null)
number of ops:  17
compiled vars:  !0 = $rp, !1 = $attribute
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $2      'ReflectionProperty'
          1        SEND_VAL_EX                                              'ChildClass'
          2        SEND_VAL_EX                                              'foo'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   20     5        INIT_METHOD_CALL                                         !0, 'getAttributes'
          6        DO_FCALL                                      0  $5      
          7      > FE_RESET_R                                       $6      $5, ->15
          8    > > FE_FETCH_R                                               $6, !1, ->15
   21     9    >   INIT_FCALL                                               'print_r'
         10        INIT_METHOD_CALL                                         !1, 'getName'
         11        DO_FCALL                                      0  $7      
         12        SEND_VAR                                                 $7
         13        DO_ICALL                                                 
   20    14      > JMP                                                      ->8
         15    >   FE_FREE                                                  $6
   22    16      > RETURN                                                   1

Class ParentAttribute: [no user functions]
Class ParentClass: [no user functions]
Class ChildAttribute: [no user functions]
Class ChildClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.24 ms | 1010 KiB | 14 Q