3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { #[MyAttr(msg: __METHOD__)] public function doFoo(#[MyAttr(msg: __METHOD__)] $param = __METHOD__): void { var_dump($param); var_dump(__METHOD__); } } $f = new Foo(); $f->doFoo(); $r = new ReflectionClass(Foo::class); $m = $r->getMethod('doFoo'); var_dump($m->getAttributes()[0]->getArguments()); $p = $m->getParameters()[0]; var_dump($p->getAttributes()[0]->getArguments());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EqGLn
function name:  (null)
number of ops:  34
compiled vars:  !0 = $f, !1 = $r, !2 = $m, !3 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $4      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
   16     3        INIT_METHOD_CALL                                         !0, 'doFoo'
          4        DO_FCALL                                      0          
   18     5        NEW                                              $8      'ReflectionClass'
          6        SEND_VAL_EX                                              'Foo'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $8
   19     9        INIT_METHOD_CALL                                         !1, 'getMethod'
         10        SEND_VAL_EX                                              'doFoo'
         11        DO_FCALL                                      0  $11     
         12        ASSIGN                                                   !2, $11
   20    13        INIT_FCALL                                               'var_dump'
         14        INIT_METHOD_CALL                                         !2, 'getAttributes'
         15        DO_FCALL                                      0  $13     
         16        FETCH_DIM_R                                      ~14     $13, 0
         17        INIT_METHOD_CALL                                         ~14, 'getArguments'
         18        DO_FCALL                                      0  $15     
         19        SEND_VAR                                                 $15
         20        DO_ICALL                                                 
   22    21        INIT_METHOD_CALL                                         !2, 'getParameters'
         22        DO_FCALL                                      0  $17     
         23        FETCH_DIM_R                                      ~18     $17, 0
         24        ASSIGN                                                   !3, ~18
   23    25        INIT_FCALL                                               'var_dump'
         26        INIT_METHOD_CALL                                         !3, 'getAttributes'
         27        DO_FCALL                                      0  $20     
         28        FETCH_DIM_R                                      ~21     $20, 0
         29        INIT_METHOD_CALL                                         ~21, 'getArguments'
         30        DO_FCALL                                      0  $22     
         31        SEND_VAR                                                 $22
         32        DO_ICALL                                                 
         33      > RETURN                                                   1

Class Foo:
Function dofoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EqGLn
function name:  doFoo
number of ops:  8
compiled vars:  !0 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV_INIT                                        !0      'Foo%3A%3AdoFoo'
    9     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   10     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAL                                                 'Foo%3A%3AdoFoo'
          6        DO_ICALL                                                 
   11     7      > RETURN                                                   null

End of function dofoo

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.23 ms | 1007 KiB | 14 Q