This has very little (if none) impact. The part where we can have some gains are finding a better data structure that would allow us to merge listeners and sort them by priority, as well as the iteration.

Now, because I removed the priority queue (for the good!) we end up with two nested foreach. The ksort also operates on string now instead of integers, so I suspect this is a bit slower (but this is the only workaround to prevent array_merge to reordering keys).