It appears when working with remote redis server.
When reading response from socket and MTU is less than fread()'s $length argument, fread() according to the documentation returns the first packet and its size is less than 4096 bytes. So returning data becomes corrupted.
Possible solution is to decrease the reading block size to 1024 bytes or to use stream_get_contents() function.
It appears when working with remote redis server. When reading response from socket and MTU is less than fread()'s $length argument, fread() according to the documentation returns the first packet and its size is less than 4096 bytes. So returning data becomes corrupted. Possible solution is to decrease the reading block size to 1024 bytes or to use stream_get_contents() function.