<?php fgets(resource $stream, ?int $length = null): string|false
<?php list($writeStream, $readStream) = $this->createSocketPair(); $loop->addReadStream($readStream, function ($stream) use ($loop) { $read = fgets($stream); if ($read === "end loop\n") { $loop->stop(); }