3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class EventManagerBase { abstract protected function attach(string $event); } final class EventManager extends EventManagerBase { protected function attach(string $event) { echo "attaching $event\n"; } } final class EventConfigurator extends EventManagerBase { private EventManagerBase $eventManager; public function __construct(EventManagerBase $eventManager, array $config) { $this->eventManager = $eventManager; foreach ($config as $event) { $this->attach($event); } } protected function attach(string $event) { $this->eventManager->attach($event); } } $eventManager = new EventManager(); $configurator = new EventConfigurator($eventManager, ['event1', 'event2']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k1e2l
function name:  (null)
number of ops:  9
compiled vars:  !0 = $eventManager, !1 = $configurator
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   NEW                                              $2      'EventManager'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   35     3        NEW                                              $5      'EventConfigurator'
          4        SEND_VAR_EX                                              !0
          5        SEND_VAL_EX                                              <array>
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
          8      > RETURN                                                   1

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

End of function attach

End of class EventManagerBase.

Class EventManager:
Function attach:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k1e2l
function name:  attach
number of ops:  6
compiled vars:  !0 = $event
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        ROPE_INIT                                     3  ~2      'attaching+'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '%0A'
          4        ECHO                                                     ~1
   13     5      > RETURN                                                   null

End of function attach

End of class EventManager.

Class EventConfigurator:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/k1e2l
function name:  __construct
number of ops:  12
compiled vars:  !0 = $eventManager, !1 = $config, !2 = $event
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   22     2        ASSIGN_OBJ                                               'eventManager'
          3        OP_DATA                                                  !0
   23     4      > FE_RESET_R                                       $4      !1, ->10
          5    > > FE_FETCH_R                                               $4, !2, ->10
   24     6    >   INIT_METHOD_CALL                                         'attach'
          7        SEND_VAR_EX                                              !2
          8        DO_FCALL                                      0          
   23     9      > JMP                                                      ->5
         10    >   FE_FREE                                                  $4
   26    11      > RETURN                                                   null

End of function __construct

Function attach:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k1e2l
function name:  attach
number of ops:  6
compiled vars:  !0 = $event
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   RECV                                             !0      
   30     1        FETCH_OBJ_R                                      ~1      'eventManager'
          2        INIT_METHOD_CALL                                         ~1, 'attach'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
   31     5      > RETURN                                                   null

End of function attach

End of class EventConfigurator.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.08 ms | 1399 KiB | 13 Q