Last time I checked, you don’t have to be in a room/channel to send to it.
You only have to be connected to TMI, you don’t have to JOIN any rooms.
But at this point the thread has just been derailed from OP’s original problem.
Which was for the most part a PHP syntax error/fun with PHP Sockets
Not relevant to the thread, since using own tokens, see line 5/6 of the source file attached. Using bot_in_the_shadows
If you are looking at JOIN/PARTS via the relevant capability, it may be quicker than the userlist.
If you are looking at the Userlist, then the userlist is also heavily cached, not just a problem of JOIN-ing but the caching on the endpoint at the HTTP level (not just the delayed processing of the events at the TMI level)
But again off topic to OP’s original issue.