Socket Server on PHP

I want to write a PHP server that will provide connection between clients using Socket.IO v4.5.1 . It must be written entirely on PHP with no JS. At first I used Ratchet and parsed messages to pass format(Socket.IO v2). But after migrating to Socket.IO v4 on client side the messages are not recognised.

I probed to find some emitters but most of them are written for a client side or support v0-v2. Socket.IO official page gives advice for JS + NodeJs servers. I can mimic a socket server but can not find any passing format and client side recognises by me only 1 type of events (“ping”-“pong”)

If it is not possible at all -> then give please advise how to rewrite the server with less JS