fgets

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Gets line from file pointer
<?php fgets(resource $stream, ?int $length = null): string|false
<?php             exit;

        }



        $testPath = fgets(STDIN);

        if ($testPath === false || $testPath === WrapperWorker::COMMAND_EXIT) {

            $application->end();

            exit;
<?php         }



        $handle = fopen($bin, 'r');

        $line = fgets($handle);

        fclose($handle);

        if (Preg::isMatch('{^#!/(?:usr/bin/env )?(?:[^/]+/)*(.+)$}m', $line, $match)) {

            return trim($match[1]);
<?php         if (feof($pipe)) {

            return;

        }

        $line = fgets($pipe);

        while ($line !== false) {

            $line = fgets($pipe);

        }
<?php         }

        $line = fgets($pipe);

        while ($line !== false) {

            $line = fgets($pipe);

        }

    }
<?php         $expectedArray = $this->getExpectedClientSpec(false);

        try {

            foreach ($expectedArray as $expected) {

                $this->assertStringStartsWith($expected, fgets($stream));

            }

            $this->assertFalse(fgets($stream));

        } catch (\Exception $e) {
<?php             foreach ($expectedArray as $expected) {

                $this->assertStringStartsWith($expected, fgets($stream));

            }

            $this->assertFalse(fgets($stream));

        } catch (\Exception $e) {

            fclose($stream);

            throw $e;
<?php         $expectedArray = $this->getExpectedClientSpec(true);

        try {

            foreach ($expectedArray as $expected) {

                $this->assertStringStartsWith($expected, fgets($stream));

            }

            $this->assertFalse(fgets($stream));

        } catch (\Exception $e) {
<?php             foreach ($expectedArray as $expected) {

                $this->assertStringStartsWith($expected, fgets($stream));

            }

            $this->assertFalse(fgets($stream));

        } catch (\Exception $e) {

            fclose($stream);

            throw $e;
<?php         list($writeStream, $readStream) = $this->createSocketPair();

        $loop->addReadStream($readStream, function ($stream) use ($loop) {


            $read = fgets($stream);

            if ($read === "end loop\n") {

                $loop->stop();

            }
<?php                     unset($sockets[(int) $stream]);

                    fclose($stream);

                } else {

                    yield (int) $stream => fgets($stream);

                }

            }

        }