xref: /PHP-8.0/ext/spl/tests/bug75917.phpt (revision daf79e2d)
1--TEST--
2Bug #75917 (SplFileObject::seek broken with CSV flags)
3--FILE--
4<?php
5$expected = [
6    ['john', 'doe', 'john.doe@example.com', '0123456789'],
7    ['jane', 'doe', 'jane.doe@example.com'],
8];
9
10$tmp = new SplTempFileObject();
11foreach ($expected as $row) {
12    $tmp->fputcsv($row);
13}
14$tmp->setFlags(0);
15$tmp->seek(23);
16var_dump($tmp->current());
17
18$tmp->setFlags(SplFileObject::READ_CSV | SplFileObject::SKIP_EMPTY);
19$tmp->seek(23);
20var_dump($tmp->current());
21?>
22--EXPECT--
23bool(false)
24bool(false)
25