diff --git a/parsecsv.lib.php b/parsecsv.lib.php index 4ea9e08..beffd1e 100644 --- a/parsecsv.lib.php +++ b/parsecsv.lib.php @@ -730,9 +730,6 @@ class parseCSV { $this->sort_reverse ? krsort($rows, $sort_type) : ksort($rows, $sort_type); - // Avoid issues with mixing string and integer keys: - $rows = array_values($rows); - if ($this->offset !== null || $this->limit !== null) { $rows = array_slice($rows, ($this->offset === null ? 0 : $this->offset), $this->limit, true); } diff --git a/tests/properties/BaseClass.php b/tests/properties/BaseClass.php index 4d9c420..1131ac8 100644 --- a/tests/properties/BaseClass.php +++ b/tests/properties/BaseClass.php @@ -26,6 +26,6 @@ class BaseClass extends PHPUnit\Framework\TestCase { $actual = array_map(function ($row) { return $row['title']; }, $this->csv->data); - $this->assertEquals($expected, $actual); + $this->assertEquals($expected, array_values($actual)); } }