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/fgetcsv_blank_file.phpt
George Peter Banyard 7ab22aad9e Refactor code handling file.current_zval (#8934)
The Zval is always an array
2022-07-28 19:36:30 +01:00

32 lines
545 B
PHP

--TEST--
SplFileObject: fgetcsv() on a blank line
--FILE--
<?php
$file_path = __DIR__ . '/SplFileObject_fgetcsv_empty.csv';
$file = new SplFileObject($file_path, 'w');
$file = new SplTempFileObject();
// write to file
$file->fwrite("");
// read from file
$file->rewind();
var_dump($file->fgetcsv());
$file->setFlags(SplFileObject::SKIP_EMPTY);
$file->rewind();
var_dump($file->fgetcsv());
?>
--CLEAN--
<?php
$file_path = __DIR__ . '/SplFileObject_fgetcsv_empty.csv';
unlink($file_path);
?>
--EXPECT--
array(1) {
[0]=>
NULL
}
bool(false)