[EventDispatcher] Add a unit test for PHP bug #62976