3v4l.org

run code in 300+ PHP versions simultaneously
<?php #[Attribute] class SomeAttribute { public function __construct(public $foo) {} } #[SomeAttribute('foo')] class Foo { private const FOO = 'foo'; } $reflector = new \ReflectionClass(Foo::class); var_dump($reflector->getAttributes());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y9Csg
function name:  (null)
number of ops:  10
compiled vars:  !0 = $reflector
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'ReflectionClass'
          1        SEND_VAL_EX                                              'Foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   14     4        INIT_FCALL                                               'var_dump'
          5        INIT_METHOD_CALL                                         !0, 'getAttributes'
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Class SomeAttribute:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y9Csg
function name:  __construct
number of ops:  4
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        ASSIGN_OBJ                                               'foo'
          2        OP_DATA                                                  !0
          3      > RETURN                                                   null

End of function __construct

End of class SomeAttribute.

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
126.55 ms | 1399 KiB | 15 Q