Phly\Http\Stream::eof PHP Method

eof() public method

public eof ( )
    public function eof()
    {
        if (!$this->resource) {
            return true;
        }
        return feof($this->resource);
    }

Usage Example

Exemplo n.º 1
0
 public function testEofReportsTrueWhenStreamIsDetached()
 {
     $this->tmpnam = tempnam(sys_get_temp_dir(), 'phly');
     file_put_contents($this->tmpnam, 'FOO BAR');
     $resource = fopen($this->tmpnam, 'wb+');
     $stream = new Stream($resource);
     fseek($resource, 2);
     $stream->detach();
     $this->assertTrue($stream->eof());
 }