ftell

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Returns the current position of the file read/write pointer
<?php ftell(resource $stream): int|false
<?php         $this->factory->sink($resource)->get('https://example.com');



        $this->assertSame(0, ftell($resource));

        $this->assertSame('abc123', stream_get_contents($resource));

    }
<?php             $contents .= $fread;

        }



        $ftell = ftell($handle);

        assert($ftell !== false);

        $this->tailPositions[$path] = $ftell;

        fclose($handle);
<?php     private function rewindStream($resource): void

    {

        if (ftell($resource) !== 0 && stream_get_meta_data($resource)['seekable']) {

            rewind($resource);

        }

    }
<?php         }



        $response->setCallback(function () use ($stream) {

            if (ftell($stream) !== 0) {

                rewind($stream);

            }

            fpassthru($stream);
<?php             if (\DIRECTORY_SEPARATOR === '\\') {

                $except = array();

                foreach ($write as $key => $socket) {

                    if (!isset($read[$key]) && @\ftell($socket) === 0) {

                        $except[$key] = $socket;

                    }

                }