Hello everybody. Let's try to execute the following code:
$em = new \Phalcon\Events\Manager();
$em->attach('component:test', function ($e) {echo '1 ';});
$em->attach('component:test', function ($e) {echo '2 ';});
$em->attach('component', function ($e) {echo '3 ';});
$em->attach('component', function ($e) {echo '4 ';});
$em->fire('component:test', $this);
The expected result - 1 2 3 4.
But in fact it's - 3 4 1 2
It seems like component listeners executed before concrete event listeners.
That behaviour is not documented and the order of listeners becomes unclear with such logic, as for me.
Thanks!