I tried to use many of the above to include in tivoka (json-rpc), but they either wasn't good enough reading larger packets (not getting the whole frame or reading into the next one) or had large dependencies.
So, I wrote https://github.com/Textalk/websocket-php
Instead of first reading all available data from the socket and then decoding it, it reads the frame header and parses payload length, and then loads just that.
It lacks ping/pong support, but I think it does most of the other stuff well. It works well with tivoka and is at least 92% autotested :) It might need some extra functions to check if there is another frame without actually reading it.
Let me know what you think.