1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/standard/tests/file/fgetcsv_variation33.phpt
2024-09-13 15:07:26 +01:00

30 lines
463 B
PHP

--TEST--
fgetcsv() with unterminated enclosure at the end of file
--FILE--
<?php
$contents = <<<EOS
"cell1","cell2"
"cell1","
EOS;
$stream = fopen('php://memory', 'w+');
fwrite($stream, $contents);
rewind($stream);
while (($data = fgetcsv($stream, escape: "\\")) !== false) {
var_dump($data);
}
fclose($stream);
?>
--EXPECT--
array(2) {
[0]=>
string(5) "cell1"
[1]=>
string(5) "cell2"
}
array(2) {
[0]=>
string(5) "cell1"
[1]=>
string(0) ""
}