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         }



        $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;