1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/ext/spl/tests/SplFileObject/SplFileObject_fgetcsv_basic.phpt
George Peter Banyard 6f87a5c633 Fix GH-8563 Different results for seek() on SplFileObject and SplTempFileObject
With memory streams if we get a NULL buffer we must not instantiate an empty line
2022-06-20 12:47:37 +01:00

34 lines
505 B
PHP

--TEST--
SplFileObject::fgetcsv default path
--FILE--
<?php
$fp = fopen('SplFileObject__fgetcsv1.csv', 'w+');
fputcsv($fp, array(
'field1',
'field2',
'field3',
5
));
fclose($fp);
$fo = new SplFileObject('SplFileObject__fgetcsv1.csv');
var_dump($fo->fgetcsv());
var_dump($fo->fgetcsv());
?>
--CLEAN--
<?php
unlink('SplFileObject__fgetcsv1.csv');
?>
--EXPECT--
array(4) {
[0]=>
string(6) "field1"
[1]=>
string(6) "field2"
[2]=>
string(6) "field3"
[3]=>
string(1) "5"
}
NULL