--TEST-- SplFileObject::fputcsv() with user provided eol --FILE-- fputcsv($record, ',', '"', '', $eol_char); } $file->rewind(); foreach ($file as $line) { echo $line; } echo "\n"; } ?> --EXPECT-- aaa,bbb,ccc,dddd||123,456,789||"""aaa""","""bbb"""|| aaa,bbb,ccc,dddd|123,456,789|"""aaa""","""bbb"""| aaa,bbb,ccc,dddd\n123,456,789\n"""aaa""","""bbb"""\n aaa,bbb,ccc,dddd 123,456,789 """aaa""","""bbb"""