3v4l.org

run code in 500+ PHP versions simultaneously
<?php #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class HookDependsOn { public function __construct( public readonly ?string $module = NULL, ) { } } #[HookDependsOn(foo: 'bar')] class Example {} $reflectionClass = new \ReflectionClass(Example::class); var_dump($reflectionClass->getAttributes()[0]->newInstance());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/31a3W
function name:  (null)
number of ops:  13
compiled vars:  !0 = $reflectionClass
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   NEW                                                  $1      'ReflectionClass'
          1        SEND_VAL_EX                                                  'Example'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $1
   19     4        INIT_FCALL                                                   'var_dump'
          5        INIT_METHOD_CALL                                             !0, 'getAttributes'
          6        DO_FCALL                                          0  $4      
          7        FETCH_DIM_R                                          ~5      $4, 0
          8        INIT_METHOD_CALL                                             ~5, 'newInstance'
          9        DO_FCALL                                          0  $6      
         10        SEND_VAR                                                     $6
         11        DO_ICALL                                                     
         12      > RETURN                                                       1

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

End of function __construct

End of class HookDependsOn.

Class Example: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.84 ms | 1463 KiB | 14 Q