1--TEST--
2Bug #77024 SplFileObject::__toString() may return array
3--FILE--
4<?php
5
6$file = new SplTempFileObject;
7$file->setCsvControl(escape: "");
8$file->fputcsv(['foo', 'bar', 'baz']);
9$file->rewind();
10$file->setFlags(SplFileObject::READ_CSV);
11echo $file . "\n";
12
13$tmp = tempnam(sys_get_temp_dir(), "php-tests-");
14file_put_contents($tmp, "line1\nline2\nline3\n");
15$file = new SplFileObject($tmp);
16$file->rewind();
17echo $file . "\n";
18unset($file);
19unlink($tmp);
20
21?>
22--EXPECT--
23foo,bar,baz
24
25line1
26