3v4l.org

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

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

End of function __construct

End of class ConstAttr.

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.3 ms | 1399 KiB | 15 Q