← All built-ins / stream_recv()
stream_recv()
stream_recv(...$args): string
Parameters
| Name | Type | Description |
|---|---|---|
| $sock | resource | socket handle |
| $max | int | maximum bytes (default 4096, max 1 MiB)optional |
Return value
Received bytes as a string ("" when nothing arrived).
Example
echo "used in registry/server.hphp and lib/websocket.hphp";
used in registry/server.hphp and lib/websocket.hphp
This call needs a real environment (window, server, database or stdin) — the snippet above shows the typical usage shape.