3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); class Slot { /** * @var callable */ public $listener; /** * @var boolean */ public $once; /** @var array */ public $params = array(); /** * @var Signal */ private $signal; function __construct(Signal $signal, $listener, $once) { $this->listener = $listener; $this->once = $once; $this->signal = $signal; } public function execute(array $values) { $resolver = $this->signal->getListenerResolver(); if ($resolver) { $callback = $resolver->resolve($this->listener); } else { $callback = $this->listener; } $args = array_merge($values, $this->params); return call_user_func_array($callback, $args); } public function getListener() { return $this->listener; } public function getOnce() { return $this->once; } } class SlotList { /** * @var Signal */ private $signal; /** * @var Slot[] */ private $slots = array(); function __construct(Signal $signal) { $this->signal = $signal; } public function add(Slot $slot) { return $this->slots[] = $slot; } public function count() { return count($this->slots); } public function execute(array $values) { $returnResultMatcher = $this->signal->getReturnResultMatcher(); foreach ($this->slots as $key => $slot) { if ($slot->once) { unset($this->slots[$key]); } $result = $slot->execute($values); if ($returnResultMatcher && $returnResultMatcher->match($result)) { return $result; } } } /** * @param callable $listener * @return Slot */ public function find($listener) { foreach ($this->slots as $slot) { if ($slot->listener === $listener) { return $slot; } } } /** * @param callable $listener * @return Slot */ public function remove($listener) { foreach ($this->slots as $key => $slot) { if ($slot->listener === $listener) { unset($this->slots[$key]); return $slot; } } } } interface ListenerResolverInterface { public function resolve($listener); } interface ListenerResolverAwareInterface { public function getListenerResolver(); public function setListenerResolver(ListenerResolverInterface $listenerResolver); } class SimpleListenerResolver implements ListenerResolverInterface { public function resolve($listener) { if (is_array($listener)) { list($class, $method) = $listener; } else if (is_string($listener) && strpos($listener, '::')) { list($class, $method) = explode('::', $listener); } if (isset($class) && !is_object($class)) { return array(new $class, $method); } return $listener; } } interface ReturnResultMatcherInterface { public function match($result); } interface ReturnResultMatcherAwareInterface { public function getReturnResultMatcher(); public function setReturnResultMatcher(ReturnResultMatcherInterface $returnResultMatcher); } class NonNullReturnResultMatcher implements ReturnResultMatcherInterface { public function match($result) { return $result !== null; } } interface OnceSignalInterface { public function addOnce($listener); public function dispatch(); public function getNumListeners(); public function remove($listener); } interface SignalInterface { public function add($listener); } abstract class AbstractOnceSignal implements OnceSignalInterface { protected $slots; public function addOnce($listener) { return $this->register($listener, true); } public function dispatch() { if (count($this->slots) < 1) { return; } $values = func_get_args(); return $this->execute($values); } public function getNumListeners() { return count($this->slots); } abstract protected function register($listener, $once); abstract protected function execute(array $values); } class OnceSignal extends AbstractOnceSignal implements ListenerResolverAwareInterface, ReturnResultMatcherAwareInterface { /** @var ListenerResolverInterface */ protected $listenerResolver; /** @var ReturnResultMatcherInterface */ protected $returnResultMatcher; /** @var mixed */ private $owner; /** * @var array */ private $valueTypes; function __construct(array $valueTypes = array(), $owner = null) { $this->valueTypes = $valueTypes; $this->owner = $owner; $this->slots = new SlotList($this); } public function addOnce($listener) { return $this->register($listener, true); } public function getNumListeners() { return $this->slots->count(); } public function getListenerResolver() { return $this->listenerResolver; } public function setListenerResolver(ListenerResolverInterface $listenerResolver) { $this->listenerResolver = $listenerResolver; } public function getReturnResultMatcher() { return $this->returnResultMatcher; } public function setReturnResultMatcher(ReturnResultMatcherInterface $returnResultMatcher) { $this->returnResultMatcher = $returnResultMatcher; } protected function execute(array $values) { // validate value types if (isset($this->owner)) { $values[] = $this->owner; } if (empty($this->listenerResolver)) { $this->setListenerResolver(new SimpleListenerResolver()); } return $this->slots->execute($values); } protected function register($listener, $once) { $existing = $this->slots->find($listener); if ($existing) { if ($existing->once !== $once) { throw new InvalidArgumentException('Once not once!'); } return $existing; } return $this->slots->add(new Slot($this, $listener, $once)); } public function remove($listener) { return $this->slots->remove($listener); } } class Signal extends OnceSignal implements SignalInterface { public function add($listener) { return $this->register($listener, false); } } class MinimalSignal extends AbstractOnceSignal implements SignalInterface { public function __construct() { $this->slots = array(); } public function add($listener) { $this->register($listener, false); } protected function execute(array $values) { foreach ($this->slots as $key => $slot) { if ($slot[1]) { unset($this->slots[$key]); } call_user_func_array($slot[0], $values); } } protected function register($listener, $once) { foreach ($this->slots as $slot) { if ($slot[0] === $listener) { if ($slot[1] !== $once) { throw new InvalidArgumentException('Once not once!'); } return; } } $this->slots[] = array($listener, $once); } public function remove($listener) { foreach ($this->slots as $key => $slot) { if ($slot[0] === $listener) { unset($this->slots[$key]); return; } } } } echo "<pre>"; class MyListener { public function onSignal(MySignalOwner $owner) { die('<pre>' . print_r($owner, 1) . __FILE__ . ' : ' . __LINE__ . "\n"); } } class MySignalOwner { /** * @var Signal */ private $signal; /** * @return Signal */ public function getSignal() { return $this->signal ? : $this->signal = new Signal(array(), $this); } } $listener = 'MyListener::onSignal'; $listener = array(new MyListener, 'onSignal'); $owner = new MySignalOwner(); $owner->getSignal()->addOnce($listener); $result = $owner->getSignal()->dispatch();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1oXUL
function name:  (null)
number of ops:  30
compiled vars:  !0 = $listener, !1 = $owner, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 -1
          2        DO_ICALL                                                 
  135     3        DECLARE_CLASS                                            'simplelistenerresolver'
  165     4        DECLARE_CLASS                                            'nonnullreturnresultmatcher'
  189     5        DECLARE_CLASS                                            'abstractoncesignal'
  216     6        DECLARE_CLASS                                            'oncesignal', 'abstractoncesignal'
  296     7        DECLARE_CLASS                                            'signal', 'oncesignal'
  304     8        DECLARE_CLASS                                            'minimalsignal', 'abstractoncesignal'
  350     9        ECHO                                                     '%3Cpre%3E'
  376    10        ASSIGN                                                   !0, 'MyListener%3A%3AonSignal'
  377    11        NEW                                              $5      'MyListener'
         12        DO_FCALL                                      0          
         13        INIT_ARRAY                                       ~7      $5
         14        ADD_ARRAY_ELEMENT                                ~7      'onSignal'
         15        ASSIGN                                                   !0, ~7
  379    16        NEW                                              $9      'MySignalOwner'
         17        DO_FCALL                                      0          
         18        ASSIGN                                                   !1, $9
  380    19        INIT_METHOD_CALL                                         !1, 'getSignal'
         20        DO_FCALL                                      0  $12     
         21        INIT_METHOD_CALL                                         $12, 'addOnce'
         22        SEND_VAR_EX                                              !0
         23        DO_FCALL                                      0          
  381    24        INIT_METHOD_CALL                                         !1, 'getSignal'
         25        DO_FCALL                                      0  $14     
         26        INIT_METHOD_CALL                                         $14, 'dispatch'
         27        DO_FCALL                                      0  $15     
         28        ASSIGN                                                   !2, $15
         29      > RETURN                                                   1

Class Slot:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1oXUL
function name:  __construct
number of ops:  10
compiled vars:  !0 = $signal, !1 = $listener, !2 = $once
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   26     3        ASSIGN_OBJ                                               'listener'
          4        OP_DATA                                                  !1
   27     5        ASSIGN_OBJ                                               'once'
          6        OP_DATA                                                  !2
   28     7        ASSIGN_OBJ                                               'signal'
          8        OP_DATA                                                  !0
   29     9      > RETURN                                                   null

End of function __construct

Function execute:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1oXUL
function name:  execute
number of ops:  27
compiled vars:  !0 = $values, !1 = $resolver, !2 = $callback, !3 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   RECV                                             !0      
   32     1        FETCH_OBJ_R                                      ~4      'signal'
          2        INIT_METHOD_CALL                                         ~4, 'getListenerResolver'
          3        DO_FCALL                                      0  $5      
          4        ASSIGN                                                   !1, $5
   34     5      > JMPZ                                                     !1, ->13
   35     6    >   INIT_METHOD_CALL                                         !1, 'resolve'
          7        CHECK_FUNC_ARG                                           
          8        FETCH_OBJ_FUNC_ARG                               $7      'listener'
          9        SEND_FUNC_ARG                                            $7
         10        DO_FCALL                                      0  $8      
         11        ASSIGN                                                   !2, $8
         12      > JMP                                                      ->15
   37    13    >   FETCH_OBJ_R                                      ~10     'listener'
         14        ASSIGN                                                   !2, ~10
   40    15    >   INIT_FCALL                                               'array_merge'
         16        SEND_VAR                                                 !0
         17        FETCH_OBJ_R                                      ~12     'params'
         18        SEND_VAL                                                 ~12
         19        DO_ICALL                                         $13     
         20        ASSIGN                                                   !3, $13
   42    21        INIT_USER_CALL                                0          'call_user_func_array', !2
         22        SEND_ARRAY                                               !3
         23        CHECK_UNDEF_ARGS                                         
         24        DO_FCALL                                      0  $15     
         25      > RETURN                                                   $15
   43    26*     > RETURN                                                   null

End of function execute

Function getlistener:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1oXUL
function name:  getListener
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   46     0  E >   FETCH_OBJ_R                                      ~0      'listener'
          1      > RETURN                                                   ~0
   47     2*     > RETURN                                                   null

End of function getlistener

Function getonce:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1oXUL
function name:  getOnce
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   50     0  E >   FETCH_OBJ_R                                      ~0      'once'
          1      > RETURN                                                   ~0
   51     2*     > RETURN                                                   null

End of function getonce

End of class Slot.

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

End of function __construct

Function add:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1oXUL
function name:  add
number of ops:  6
compiled vars:  !0 = $slot
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   71     0  E >   RECV                                             !0      
   72     1        FETCH_OBJ_W                                      $1      'slots'
          2        ASSIGN_DIM                                       ~2      $1
          3        OP_DATA                                                  !0
          4      > RETURN                                                   ~2
   73     5*     > RETURN                                                   null

End of function add

Function count:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1oXUL
function name:  count
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   76     0  E >   FETCH_OBJ_R                                      ~0      'slots'
          1        COUNT                                            ~1      ~0
          2      > RETURN                                                   ~1
   77     3*     > RETURN                                                   null

End of function count

Function execute:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 26
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 26
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
2 jumps found. (Code = 46) Position 1 = 18, Position 2 = 22
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 22
Branch analysis from position: 13
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/1oXUL
function name:  execute
number of ops:  28
compiled vars:  !0 = $values, !1 = $returnResultMatcher, !2 = $slot, !3 = $key, !4 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   79     0  E >   RECV                                             !0      
   80     1        FETCH_OBJ_R                                      ~5      'signal'
          2        INIT_METHOD_CALL                                         ~5, 'getReturnResultMatcher'
          3        DO_FCALL                                      0  $6      
          4        ASSIGN                                                   !1, $6
   82     5        FETCH_OBJ_R                                      ~8      'slots'
          6      > FE_RESET_R                                       $9      ~8, ->26
          7    > > FE_FETCH_R                                       ~10     $9, !2, ->26
          8    >   ASSIGN                                                   !3, ~10
   83     9        FETCH_OBJ_R                                      ~12     !2, 'once'
         10      > JMPZ                                                     ~12, ->13
   84    11    >   FETCH_OBJ_UNSET                                  $13     'slots'
         12        UNSET_DIM                                                $13, !3
   87    13    >   INIT_METHOD_CALL                                         !2, 'execute'
         14        SEND_VAR_EX                                              !0
         15        DO_FCALL                                      0  $14     
         16        ASSIGN                                                   !4, $14
   89    17      > JMPZ_EX                                          ~16     !1, ->22
         18    >   INIT_METHOD_CALL                                         !1, 'match'
         19        SEND_VAR_EX                                              !4
         20        DO_FCALL                                      0  $17     
         21        BOOL                                             ~16     $17
         22    > > JMPZ                                                     ~16, ->25
   90    23    >   FE_FREE                                                  $9
         24      > RETURN                                                   !4
   82    25    > > JMP                                                      ->7
         26    >   FE_FREE                                                  $9
   93    27      > RETURN                                                   null

End of function execute

Function find:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/1oXUL
function name:  find
number of ops:  12
compiled vars:  !0 = $listener, !1 = $slot
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   99     0  E >   RECV                                             !0      
  100     1        FETCH_OBJ_R                                      ~2      'slots'
          2      > FE_RESET_R                                       $3      ~2, ->10
          3    > > FE_FETCH_R                                               $3, !1, ->10
  101     4    >   FETCH_OBJ_R                                      ~4      !1, 'listener'
          5        IS_IDENTICAL                                             !0, ~4
          6      > JMPZ                                                     ~5, ->9
  102     7    >   FE_FREE                                                  $3
          8      > RETURN                                                   !1
  100     9    > > JMP                                                      ->3
         10    >   FE_FREE                                                  $3
  105    11      > RETURN                                                   null

End of function find

Function remove:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/1oXUL
function name:  remove
number of ops:  15
compiled vars:  !0 = $listener, !1 = $slot, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  111     0  E >   RECV                                             !0      
  112     1        FETCH_OBJ_R                                      ~3      'slots'
          2      > FE_RESET_R                                       $4      ~3, ->13
          3    > > FE_FETCH_R                                       ~5      $4, !1, ->13
          4    >   ASSIGN                                                   !2, ~5
  113     5        FETCH_OBJ_R                                      ~7      !1, 'listener'
          6        IS_IDENTICAL                                             !0, ~7
          7      > JMPZ                                                     ~8, ->12
  114     8    >   FETCH_OBJ_UNSET                                  $9      'slots'
          9        UNSET_DIM                                                $9, !2
  116    10        FE_FREE                                                  $4
         11      > RETURN                                                   !1
  112    12    > > JMP                                                      ->3
         13    >   FE_FREE                                                  $4
  119    14      > RETURN                                                   null

End of function remove

End of class SlotList.

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

End of function resolve

End of class ListenerResolverInterface.

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

End of function getlistenerresolver

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

End of function setlistenerresolver

End of class ListenerResolverAwareInterface.

Class SimpleListenerResolver:
Function resolve:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 46) Position 1 = 29, Position 2 = 32
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 39
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
Branch analysis from position: 10
2 jumps found. (Code = 46) Position 1 = 12, Position 2 = 17
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 27
Branch analysis from position: 18
2 jumps found. (Code = 46) Position 1 = 29, Position 2 = 32
Branch analysis from position: 29
Branch analysis from position: 32
Branch analysis from position: 27
Branch analysis from position: 17
filename:       /in/1oXUL
function name:  resolve
number of ops:  41
compiled vars:  !0 = $listener, !1 = $class, !2 = $method
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  137     0  E >   RECV                                             !0      
  138     1        TYPE_CHECK                                  128          !0
          2      > JMPZ                                                     ~3, ->10
  139     3    >   QM_ASSIGN                                        ~4      !0
          4        FETCH_LIST_R                                     $5      ~4, 0
          5        ASSIGN                                                   !1, $5
          6        FETCH_LIST_R                                     $7      ~4, 1
          7        ASSIGN                                                   !2, $7
          8        FREE                                                     ~4
          9      > JMP                                                      ->27
  140    10    >   TYPE_CHECK                                   64  ~9      !0
         11      > JMPZ_EX                                          ~9      ~9, ->17
         12    >   INIT_FCALL                                               'strpos'
         13        SEND_VAR                                                 !0
         14        SEND_VAL                                                 '%3A%3A'
         15        DO_ICALL                                         $10     
         16        BOOL                                             ~9      $10
         17    > > JMPZ                                                     ~9, ->27
  141    18    >   INIT_FCALL                                               'explode'
         19        SEND_VAL                                                 '%3A%3A'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $11     
         22        FETCH_LIST_R                                     $12     $11, 0
         23        ASSIGN                                                   !1, $12
         24        FETCH_LIST_R                                     $14     $11, 1
         25        ASSIGN                                                   !2, $14
         26        FREE                                                     $11
  144    27    >   ISSET_ISEMPTY_CV                                 ~16     !1
         28      > JMPZ_EX                                          ~16     ~16, ->32
         29    >   TYPE_CHECK                                  256  ~17     !1
         30        BOOL_NOT                                         ~18     ~17
         31        BOOL                                             ~16     ~18
         32    > > JMPZ                                                     ~16, ->39
  145    33    >   FETCH_CLASS                                   0  $19     !1
         34        NEW                                              $20     $19
         35        DO_FCALL                                      0          
         36        INIT_ARRAY                                       ~22     $20
         37        ADD_ARRAY_ELEMENT                                ~22     !2
         38      > RETURN                                                   ~22
  148    39    > > RETURN                                                   !0
  149    40*     > RETURN                                                   null

End of function resolve

End of class SimpleListenerResolver.

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

End of function match

End of class ReturnResultMatcherInterface.

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

End of function getreturnresultmatcher

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

End of function setreturnresultmatcher

End of class ReturnResultMatcherAwareInterface.

Class NonNullReturnResultMatcher:
Function match:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1oXUL
function name:  match
number of ops:  4
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  167     0  E >   RECV                                             !0      
  168     1        TYPE_CHECK                                  1020  ~1      !0
          2      > RETURN                                                   ~1
  169     3*     > RETURN                                                   null

End of function match

End of class NonNullReturnResultMatcher.

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

End of function addonce

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

End of function dispatch

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

End of function getnumlisteners

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

End of function remove

End of class OnceSignalInterface.

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

End of function add

End of class SignalInterface.

Class AbstractOnceSignal:
Function addonce:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1oXUL
function name:  addOnce
number of ops:  7
compiled vars:  !0 = $listener
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  193     0  E >   RECV                                             !0      
  194     1        INIT_METHOD_CALL                                         'register'
          2        SEND_VAR_EX                                              !0
          3        SEND_VAL_EX                                              <true>
          4        DO_FCALL                                      0  $1      
          5      > RETURN                                                   $1
  195     6*     > RETURN                                                   null

End of function addonce

Function dispatch:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1oXUL
function name:  dispatch
number of ops:  12
compiled vars:  !0 = $values
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  198     0  E >   FETCH_OBJ_R                                      ~1      'slots'
          1        COUNT                                            ~2      ~1
          2        IS_SMALLER                                               ~2, 1
          3      > JMPZ                                                     ~3, ->5
  199     4    > > RETURN                                                   null
  202     5    >   FUNC_GET_ARGS                                    ~4      
          6        ASSIGN                                                   !0, ~4
  204     7        INIT_METHOD_CALL                                         'execute'
          8

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
267.66 ms | 1428 KiB | 22 Q