public function __construct($filename) { $this->filename = $filename; $this->position = 0; if (is_file($filename)) { throw new \RuntimeException(sprintf('The file %s already exist', $filename)); } }