EventBase object is supposed to be created for each event loop. If a bunch
of HTTP requests is meant to be run within the context of a single event
loop, then it is sufficient to create only one instance of EventBase.

The cryptic error message is dispatched directly from Libevent, and usually
means that some event object has been destroyed prematurely (before the
loop is stopped).

In order to prevent such kind of issues you should keep
references to the event objects until the loop finishes its work. E.g.:

I recommend destroying the objects explicitly (by assigning null) as it is done above in the destructor. Some classes have free methods for freeing the internal libevent data structures. However, most of the time you will need freeing the PHP variables as well: $this->object->free(); $this->object = null. Note that the object destructor handlers actually do cleanup the internal libevent structures, so you don't need to call free(), if the variable is destroyed.

It is very likely that the error message is caused by an event object being destroyed after going out of scope, e.g.:

<?phppublicfunctionsomeMethod(){$req=newEventHttpRequest([$this,'requestHandler'],$this->base);...// $req gets destroyed when it goes out of scope of the function,// if you do not save a reference to it!}