I think php sockets and php streams are overlapping each other.
I\'ve managed to make a CLI PHP chat client and a server, using either sockets or streams.
Here som
As you pointed out, 'streams' are in PHP core (built-in, always available) while 'sockets' are part of a rarely included extension. Other than that, they are nearly identical. You can use both TCP and UDP with streams with both as well as blocking and non-blocking modes, which covers 99% of all use-cases.
The only common exception I can think of is ICMP. For example, 'ping'. However, it looks like there currently isn't a safe way to do ICMP from PHP. Such calls require SOCK_RAW via the socket extension, which requires 'root' privileges to execute. Also, not all routers will route other packet types outside of TCP, UDP, and ICMP. This limits the usefulness of the socket extension.