3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(array $a) { } $class = new \ReflectionClass('ReflectionClass'); $method = $class->getMethod('getMethod'); $parameters = $method->getParameters(); $aParameter = $parameters[0]; /* $functionReflection = new ReflectionFunction('foo'); $parameters = $functionReflection->getParameters(); $aParameter = $parameters[0]; */ var_dump($method->getName()); var_dump($aParameter->getName()); var_dump($aParameter->getDeclaringFunction()->getName());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JZoSl
function name:  (null)
number of ops:  31
compiled vars:  !0 = $class, !1 = $method, !2 = $parameters, !3 = $aParameter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                                              $4      'ReflectionClass'
          1        SEND_VAL_EX                                              'ReflectionClass'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
    5     4        INIT_METHOD_CALL                                         !0, 'getMethod'
          5        SEND_VAL_EX                                              'getMethod'
          6        DO_FCALL                                      0  $7      
          7        ASSIGN                                                   !1, $7
    6     8        INIT_METHOD_CALL                                         !1, 'getParameters'
          9        DO_FCALL                                      0  $9      
         10        ASSIGN                                                   !2, $9
    7    11        FETCH_DIM_R                                      ~11     !2, 0
         12        ASSIGN                                                   !3, ~11
   14    13        INIT_FCALL                                               'var_dump'
         14        INIT_METHOD_CALL                                         !1, 'getName'
         15        DO_FCALL                                      0  $13     
         16        SEND_VAR                                                 $13
         17        DO_ICALL                                                 
   15    18        INIT_FCALL                                               'var_dump'
         19        INIT_METHOD_CALL                                         !3, 'getName'
         20        DO_FCALL                                      0  $15     
         21        SEND_VAR                                                 $15
         22        DO_ICALL                                                 
   16    23        INIT_FCALL                                               'var_dump'
         24        INIT_METHOD_CALL                                         !3, 'getDeclaringFunction'
         25        DO_FCALL                                      0  $17     
         26        INIT_METHOD_CALL                                         $17, 'getName'
         27        DO_FCALL                                      0  $18     
         28        SEND_VAR                                                 $18
         29        DO_ICALL                                                 
         30      > RETURN                                                   1

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

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.87 ms | 1396 KiB | 15 Q