With this example you will be able to use modern PHP code and have multiple clients connected.
The code is inspired and sourced from the of the posted notes here.
If you CTRL-C stopped the server, run the script twice. The first time will clean up the left over socket. Or just remove the socket file before starting the server.
There is a "magic" command (STOP) in the code to stop the server, you can easily remove it.