1--TEST-- 2fgetcsv() with unterminated enclosure at the end of file 3--FILE-- 4<?php 5$contents = <<<EOS 6"cell1","cell2" 7"cell1"," 8EOS; 9$stream = fopen('php://memory', 'w+'); 10fwrite($stream, $contents); 11rewind($stream); 12while (($data = fgetcsv($stream, escape: "\\")) !== false) { 13 var_dump($data); 14} 15fclose($stream); 16?> 17--EXPECT-- 18array(2) { 19 [0]=> 20 string(5) "cell1" 21 [1]=> 22 string(5) "cell2" 23} 24array(2) { 25 [0]=> 26 string(5) "cell1" 27 [1]=> 28 string(0) "" 29} 30