3v4l.org

run code in 300+ PHP versions simultaneously
<?php class EventDispatcher{function r($e, ListenerInterface $l){$this->e[$e][] = $l;} function d($e){foreach ($this->e[$e] as $l){$l->o();}}} interface ListenerInterface{function o();} class MyListener implements ListenerInterface{function o(){echo '*';}} $l = new MyListener(); $e = new EventDispatcher(); $e->r('1', $l); $e->r('1', $l); $e->r('2', $l); $e->d('1');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kUkEU
function name:  (null)
number of ops:  23
compiled vars:  !0 = $l, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   DECLARE_CLASS                                            'mylistener'
    8     1        NEW                                              $2      'MyListener'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
    9     4        NEW                                              $5      'EventDispatcher'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
   10     7        INIT_METHOD_CALL                                         !1, 'r'
          8        SEND_VAL_EX                                              '1'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0          
   11    11        INIT_METHOD_CALL                                         !1, 'r'
         12        SEND_VAL_EX                                              '1'
         13        SEND_VAR_EX                                              !0
         14        DO_FCALL                                      0          
   12    15        INIT_METHOD_CALL                                         !1, 'r'
         16        SEND_VAL_EX                                              '2'
         17        SEND_VAR_EX                                              !0
         18        DO_FCALL                                      0          
   13    19        INIT_METHOD_CALL                                         !1, 'd'
         20        SEND_VAL_EX                                              '1'
         21        DO_FCALL                                      0          
         22      > RETURN                                                   1

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

End of function r

Function d:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/kUkEU
function name:  d
number of ops:  10
compiled vars:  !0 = $e, !1 = $l
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   RECV                                             !0      
          1        FETCH_OBJ_R                                      ~2      'e'
          2        FETCH_DIM_R                                      ~3      ~2, !0
          3      > FE_RESET_R                                       $4      ~3, ->8
          4    > > FE_FETCH_R                                               $4, !1, ->8
          5    >   INIT_METHOD_CALL                                         !1, 'o'
          6        DO_FCALL                                      0          
          7      > JMP                                                      ->4
          8    >   FE_FREE                                                  $4
          9      > RETURN                                                   null

End of function d

End of class EventDispatcher.

Class ListenerInterface:
Function o:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kUkEU
function name:  o
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > RETURN                                                   null

End of function o

End of class ListenerInterface.

Class MyListener:
Function o:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kUkEU
function name:  o
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ECHO                                                     '%2A'
          1      > RETURN                                                   null

End of function o

End of class MyListener.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.33 ms | 1390 KiB | 13 Q