3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function __construct(Bar $test) { } } class Bar { public function __construct() { } } $reflection = new ReflectionClass('Foo'); $params = $reflection->getConstructor()->getParameters(); foreach ($params AS $param) { var_dump($param); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/eteG0
function name:  (null)
number of ops:  17
compiled vars:  !0 = $reflection, !1 = $params, !2 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $3      'ReflectionClass'
          1        SEND_VAL_EX                                              'Foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
   14     4        INIT_METHOD_CALL                                         !0, 'getConstructor'
          5        DO_FCALL                                      0  $6      
          6        INIT_METHOD_CALL                                         $6, 'getParameters'
          7        DO_FCALL                                      0  $7      
          8        ASSIGN                                                   !1, $7
   15     9      > FE_RESET_R                                       $9      !1, ->15
         10    > > FE_FETCH_R                                               $9, !2, ->15
   16    11    >   INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                                 
   15    14      > JMP                                                      ->10
         15    >   FE_FREE                                                  $9
   17    16      > RETURN                                                   1

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

End of function __construct

End of class Foo.

Class Bar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eteG0
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E > > RETURN                                                   null

End of function __construct

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.32 ms | 1396 KiB | 15 Q