Skip to content

Commit 34aca6e

Browse files
authored
Merge pull request #13 from PHP-CSV/bugfix/fix_get_record_returning_an_array_of_null
Bugfix on the getRecord we should not return null fatal error
2 parents 7f2e803 + e4156b3 commit 34aca6e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Readers/SplCsvReader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ public function getRecord(): array|false
118118
$reader->seek($this->getCurrentPosition());
119119
$record = $reader->current();
120120

121+
$this->position++;
122+
121123
if ($record === false) {
122124
return false;
123125
}
@@ -130,8 +132,6 @@ public function getRecord(): array|false
130132
return false;
131133
}
132134

133-
$this->position++;
134-
135135
return $record;
136136
}
137137

0 commit comments

Comments
 (0)