God Money, I’ll do anything for you
The loop
1 2 3 4 5 | <?php while ($read < $n && (false !== ($buf = fread($this->sock, $n - $read)))) { /* ... */ } ?> |
contains a subtle bug. Go ahead, read the relevant function documentation and see if you can spot it.
