3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyService { public function __construct(MyService $service, $value) { $this->service = $service; $this->value = $value; // pretty common right? } } class MyServiceFactory { private $request; private $provider; function __construct(Request $request, \Auryn\Provider $provider) { $this->request = $request; $this->provider = $provider; } public function create() { $userSuppliedValue = $this->request->getValue('postValue'); return $this->provider->make('MyService', [':value' => $userSuppliedValue]); } } class Controller { public function indexAction(MyServiceFactory $factory) { $service = $factory->create(); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AVIDe
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E > > RETURN                                                   1

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

End of function __construct

End of class MyService.

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

End of function __construct

Function create:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AVIDe
function name:  create
number of ops:  13
compiled vars:  !0 = $userSuppliedValue
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   FETCH_OBJ_R                                      ~1      'request'
          1        INIT_METHOD_CALL                                         ~1, 'getValue'
          2        SEND_VAL_EX                                              'postValue'
          3        DO_FCALL                                      0  $2      
          4        ASSIGN                                                   !0, $2
   23     5        FETCH_OBJ_R                                      ~4      'provider'
          6        INIT_METHOD_CALL                                         ~4, 'make'
          7        SEND_VAL_EX                                              'MyService'
          8        INIT_ARRAY                                       ~5      !0, '%3Avalue'
          9        SEND_VAL_EX                                              ~5
         10        DO_FCALL                                      0  $6      
         11      > RETURN                                                   $6
   24    12*     > RETURN                                                   null

End of function create

End of class MyServiceFactory.

Class Controller:
Function indexaction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AVIDe
function name:  indexAction
number of ops:  5
compiled vars:  !0 = $factory, !1 = $service
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   RECV                                             !0      
   30     1        INIT_METHOD_CALL                                         !0, 'create'
          2        DO_FCALL                                      0  $2      
          3        ASSIGN                                                   !1, $2
   31     4      > RETURN                                                   null

End of function indexaction

End of class Controller.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.21 ms | 1399 KiB | 13 Q