3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Yiisoft\EventDispatcher\Provider; abstract class AbstractProviderConfigurator { protected function attach(callable $listener, string $eventClassName = ''): void { throw new \RuntimeException("Method 'attach' does not exist."); } } class Provider extends AbstractProviderConfigurator { private $providers = []; protected function attach(callable $listener, string $eventClassName = ''): void { $this->providers[$eventClassName] = $listener; } public function getProviders(): array { return $this->providers; } } class MyProvider extends Provider { public function attach(callable $listener, string $eventClassName = ''): void { parent::attach($listener, $eventClassName); } } $provider = new MyProvider(); $provider->attach(function () { return true; }, 'MyEvent'); var_dump($provider->getProviders());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HCcHQ
function name:  (null)
number of ops:  14
compiled vars:  !0 = $provider
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E >   NEW                                              $1      'Yiisoft%5CEventDispatcher%5CProvider%5CMyProvider'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   39     3        INIT_METHOD_CALL                                         !0, 'attach'
          4        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
   41     5        SEND_VAL_EX                                              ~4
          6        SEND_VAL_EX                                              'MyEvent'
   39     7        DO_FCALL                                      0          
   43     8        INIT_NS_FCALL_BY_NAME                                    'Yiisoft%5CEventDispatcher%5CProvider%5Cvar_dump'
          9        INIT_METHOD_CALL                                         !0, 'getProviders'
         10        DO_FCALL                                      0  $6      
         11        SEND_VAR_NO_REF_EX                                       $6
         12        DO_FCALL                                      0          
         13      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HCcHQ
function name:  Yiisoft\EventDispatcher\Provider\{closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E > > RETURN                                                   <true>
   41     1*     > RETURN                                                   null

End of Dynamic Function 0

Class Yiisoft\EventDispatcher\Provider\AbstractProviderConfigurator:
Function attach:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/HCcHQ
function name:  attach
number of ops:  7
compiled vars:  !0 = $listener, !1 = $eventClassName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      ''
    9     2        NEW                                              $2      'RuntimeException'
          3        SEND_VAL_EX                                              'Method+%27attach%27+does+not+exist.'
          4        DO_FCALL                                      0          
          5      > THROW                                         0          $2
   10     6*     > RETURN                                                   null

End of function attach

End of class Yiisoft\EventDispatcher\Provider\AbstractProviderConfigurator.

Class Yiisoft\EventDispatcher\Provider\Provider:
Function attach:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HCcHQ
function name:  attach
number of ops:  6
compiled vars:  !0 = $listener, !1 = $eventClassName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      ''
   19     2        FETCH_OBJ_W                                      $2      'providers'
          3        ASSIGN_DIM                                               $2, !1
          4        OP_DATA                                                  !0
   20     5      > RETURN                                                   null

End of function attach

Function getproviders:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HCcHQ
function name:  getProviders
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   FETCH_OBJ_R                                      ~0      'providers'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   25     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getproviders

End of class Yiisoft\EventDispatcher\Provider\Provider.

Class Yiisoft\EventDispatcher\Provider\MyProvider:
Function attach:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HCcHQ
function name:  attach
number of ops:  7
compiled vars:  !0 = $listener, !1 = $eventClassName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      ''
   32     2        INIT_STATIC_METHOD_CALL                                  'attach'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
   33     6      > RETURN                                                   null

End of function attach

Function getproviders:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HCcHQ
function name:  getProviders
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   FETCH_OBJ_R                                      ~0      'providers'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   25     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getproviders

End of class Yiisoft\EventDispatcher\Provider\MyProvider.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
293.54 ms | 1015 KiB | 14 Q