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) { echo $param->getClass()->name . '<br>'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 17
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/vCCA8
function name:  (null)
number of ops:  19
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, ->17
         10    > > FE_FETCH_R                                               $9, !2, ->17
   16    11    >   INIT_METHOD_CALL                                         !2, 'getClass'
         12        DO_FCALL                                      0  $10     
         13        FETCH_OBJ_R                                      ~11     $10, 'name'
         14        CONCAT                                           ~12     ~11, '%3Cbr%3E'
         15        ECHO                                                     ~12
   15    16      > JMP                                                      ->10
         17    >   FE_FREE                                                  $9
   17    18      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vCCA8
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/vCCA8
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:
127.8 ms | 1399 KiB | 13 Q