3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace MyNamespace; class MyClass { function foo(iterable $iterable, array $array, int $int) { } } $reflection = new \ReflectionMethod(MyClass::class, 'foo'); $parameters = $reflection->getParameters(); echo (string) $parameters[0]->getType(), PHP_EOL; echo (string) $parameters[1]->getType(), PHP_EOL; echo (string) $parameters[2]->getType(), PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/quhbu
function name:  (null)
number of ops:  30
compiled vars:  !0 = $reflection, !1 = $parameters
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $2      'ReflectionMethod'
          1        SEND_VAL_EX                                              'MyNamespace%5CMyClass'
          2        SEND_VAL_EX                                              'foo'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   12     5        INIT_METHOD_CALL                                         !0, 'getParameters'
          6        DO_FCALL                                      0  $5      
          7        ASSIGN                                                   !1, $5
   13     8        FETCH_DIM_R                                      ~7      !1, 0
          9        INIT_METHOD_CALL                                         ~7, 'getType'
         10        DO_FCALL                                      0  $8      
         11        CAST                                          6  ~9      $8
         12        ECHO                                                     ~9
         13        FETCH_CONSTANT                                   ~10     'MyNamespace%5CPHP_EOL'
         14        ECHO                                                     ~10
   14    15        FETCH_DIM_R                                      ~11     !1, 1
         16        INIT_METHOD_CALL                                         ~11, 'getType'
         17        DO_FCALL                                      0  $12     
         18        CAST                                          6  ~13     $12
         19        ECHO                                                     ~13
         20        FETCH_CONSTANT                                   ~14     'MyNamespace%5CPHP_EOL'
         21        ECHO                                                     ~14
   15    22        FETCH_DIM_R                                      ~15     !1, 2
         23        INIT_METHOD_CALL                                         ~15, 'getType'
         24        DO_FCALL                                      0  $16     
         25        CAST                                          6  ~17     $16
         26        ECHO                                                     ~17
         27        FETCH_CONSTANT                                   ~18     'MyNamespace%5CPHP_EOL'
         28        ECHO                                                     ~18
         29      > RETURN                                                   1

Class MyNamespace\MyClass:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/quhbu
function name:  foo
number of ops:  4
compiled vars:  !0 = $iterable, !1 = $array, !2 = $int
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    8     3      > RETURN                                                   null

End of function foo

End of class MyNamespace\MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168 ms | 1395 KiB | 13 Q