3v4l.org

run code in 300+ PHP versions simultaneously
<?php use Selami\Foundation\App; use Psr\Logging\Logger; class MyClass { public function __construct(App $app, Logger $log) { } } $method = new ReflectionMethod(MyClass::class, '__construct'); $parameters = $method->getParameters(); var_dump($parameters); foreach($parameters as $param) { $param->getClass(); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/YWKUL
function name:  (null)
number of ops:  18
compiled vars:  !0 = $method, !1 = $parameters, !2 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $3      'ReflectionMethod'
          1        SEND_VAL_EX                                              'MyClass'
          2        SEND_VAL_EX                                              '__construct'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $3
   16     5        INIT_METHOD_CALL                                         !0, 'getParameters'
          6        DO_FCALL                                      0  $6      
          7        ASSIGN                                                   !1, $6
   17     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
   20    11      > FE_RESET_R                                       $9      !1, ->16
         12    > > FE_FETCH_R                                               $9, !2, ->16
   22    13    >   INIT_METHOD_CALL                                         !2, 'getClass'
         14        DO_FCALL                                      0          
   20    15      > JMP                                                      ->12
         16    >   FE_FREE                                                  $9
   23    17      > RETURN                                                   1

Class MyClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YWKUL
function name:  __construct
number of ops:  3
compiled vars:  !0 = $app, !1 = $log
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   11     2      > RETURN                                                   null

End of function __construct

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.67 ms | 1395 KiB | 15 Q