3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ThingManager { public function __construct(ThingFactory $thingFactory) { $this->thingFactory = $thingFactory; } public function doSomething() { return new $this->thingFactory->create(); } } class ThingFactory { public function create() { return new Thing; } } class Thing {}
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RMpHZ
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E > > RETURN                                                   1

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

End of function __construct

Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RMpHZ
function name:  doSomething
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_OBJ_R                                      ~0      'thingFactory'
          1        FETCH_OBJ_R                                      ~1      ~0, 'create'
          2        FETCH_CLASS                                   0  $2      ~1
          3        NEW                                              $3      $2
          4        DO_FCALL                                      0          
          5      > RETURN                                                   $3
   13     6*     > RETURN                                                   null

End of function dosomething

End of class ThingManager.

Class ThingFactory:
Function create:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RMpHZ
function name:  create
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $0      'Thing'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
   21     3*     > RETURN                                                   null

End of function create

End of class ThingFactory.

Class Thing: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.7 ms | 1394 KiB | 13 Q