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{function o(){echo '*';}} $l = new MyListener(); $e = new EventDispatcher(); $e->r('1', $l); $e->r('1', $l); $e->r('2', $l); $e->d();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YntAA
function name:  (null)
number of ops:  21
compiled vars:  !0 = $l, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $2      'MyListener'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    9     3        NEW                                              $5      'EventDispatcher'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   10     6        INIT_METHOD_CALL                                         !1, 'r'
          7        SEND_VAL_EX                                              '1'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
   11    10        INIT_METHOD_CALL                                         !1, 'r'
         11        SEND_VAL_EX                                              '1'
         12        SEND_VAR_EX                                              !0
         13        DO_FCALL                                      0          
   12    14        INIT_METHOD_CALL                                         !1, 'r'
         15        SEND_VAL_EX                                              '2'
         16        SEND_VAR_EX                                              !0
         17        DO_FCALL                                      0          
   13    18        INIT_METHOD_CALL                                         !1, 'd'
         19        DO_FCALL                                      0          
         20      > RETURN                                                   1

Class EventDispatcher:
Function r:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YntAA
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/YntAA
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/YntAA
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/YntAA
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:
148.51 ms | 1399 KiB | 13 Q