Changeset View
Changeset View
Standalone View
Standalone View
src/filesystem/linesofalarge/LinesOfALarge.php
Show First 20 Lines • Show All 206 Lines • ▼ Show 20 Lines | while (true) { | ||||
// No more bytes. If we have a buffer, return its contents. We | // No more bytes. If we have a buffer, return its contents. We | ||||
// potentially return part of a line here if the last line had no | // potentially return part of a line here if the last line had no | ||||
// delimiter, but that currently seems reasonable as a default | // delimiter, but that currently seems reasonable as a default | ||||
// behavior. If we don't have a buffer, we're done. | // behavior. If we don't have a buffer, we're done. | ||||
$this->eof = true; | $this->eof = true; | ||||
if (strlen($this->buf)) { | if (strlen($this->buf)) { | ||||
$this->num++; | $this->num++; | ||||
$this->line = $this->buf; | $this->line = $this->buf; | ||||
$this->buf = null; | $this->buf = ''; | ||||
} else { | } else { | ||||
$this->valid = false; | $this->valid = false; | ||||
} | } | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0