3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Controller { public function __construct(B $b) { $this->b = $b; } } class B { public function __construct(C $c) { $this->c = $c; } } class C { public function __construct(Guzzle $guzzle) { $this->guzzle = $guzzle; } } class Guzzle { } $getReflectedConstructorParams = function($className) { return (new \ReflectionClass($className))->getConstructor()->getParameters(); }; $className = 'Controller'; $graph = [$className]; // I hate recursion, there's much better ways while (!empty($getReflectedConstructorParams($className))) { $className = $getReflectedConstructorParams($className); $graph[] = $className; } var_dump($className);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 6
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 6
Branch analysis from position: 18
Branch analysis from position: 6
filename:       /in/Oa9Wk
function name:  (null)
number of ops:  22
compiled vars:  !0 = $getReflectedConstructorParams, !1 = $className, !2 = $graph
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FOa9Wk%3A8%240'
          1        ASSIGN                                                   !0, ~3
   12     2        ASSIGN                                                   !1, 'Controller'
   13     3        INIT_ARRAY                                       ~6      !1
          4        ASSIGN                                                   !2, ~6
   16     5      > JMP                                                      ->12
   18     6    >   INIT_DYNAMIC_CALL                                        !0
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0  $8      
          9        ASSIGN                                                   !1, $8
   19    10        ASSIGN_DIM                                               !2
         11        OP_DATA                                                  !1
   16    12    >   INIT_DYNAMIC_CALL                                        !0
         13        SEND_VAR_EX                                              !1
         14        DO_FCALL                                      0  $11     
         15        BOOL_NOT                                         ~12     $11
         16        BOOL_NOT                                         ~13     ~12
         17      > JMPNZ                                                    ~13, ->6
   22    18    >   INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FOa9Wk%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Oa9Wk
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $className
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        NEW                                              $1      'ReflectionClass'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        INIT_METHOD_CALL                                         $1, 'getConstructor'
          5        DO_FCALL                                      0  $3      
          6        INIT_METHOD_CALL                                         $3, 'getParameters'
          7        DO_FCALL                                      0  $4      
          8      > RETURN                                                   $4
   10     9*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FOa9Wk%3A8%240

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

End of function __construct

End of class Controller.

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

End of function __construct

End of class B.

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

End of function __construct

End of class C.

Class Guzzle: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.35 ms | 1400 KiB | 15 Q