3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C { static function f() { $php = ' namespace U; return #[A(self::U)] static function () {}; '; return eval($php); } } $rf = new \ReflectionFunction(C::f()); $ra = $rf->getAttributes()[0]; $ra->getArguments();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m1aZp
function name:  (null)
number of ops:  13
compiled vars:  !0 = $rf, !1 = $ra
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $2      'ReflectionFunction'
          1        INIT_STATIC_METHOD_CALL                                  'C', 'f'
          2        DO_FCALL                                      0  $3      
          3        SEND_VAR_NO_REF_EX                                       $3
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
   16     6        INIT_METHOD_CALL                                         !0, 'getAttributes'
          7        DO_FCALL                                      0  $6      
          8        FETCH_DIM_R                                      ~7      $6, 0
          9        ASSIGN                                                   !1, ~7
   17    10        INIT_METHOD_CALL                                         !1, 'getArguments'
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Class C:
Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m1aZp
function name:  f
number of ops:  4
compiled vars:  !0 = $php
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, '%0A++++++++++++namespace+U%3B%0A++++++++++++return%0A++++++++++++++++%23%5BA%28self%3A%3AU%29%5D%0A++++++++++++++++static+function+%28%29+%7B%7D%3B%0A++++++++'
   11     1        INCLUDE_OR_EVAL                                  $2      !0, EVAL
          2      > RETURN                                                   $2
   12     3*     > RETURN                                                   null

End of function f

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.7 ms | 1393 KiB | 13 Q