summaryrefslogtreecommitdiff
path: root/ext/spl/tests/SplFileObject_fgetcsv_escape_error.phpt
blob: a1471c8e0e7d7ea03ba178ec83b67617e8c871ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--TEST--
SplFileObject::fgetcsv with alternative delimiter
--FILE--
<?php
$fp = fopen('SplFileObject__fgetcsv8.csv', 'w+');
fwrite($fp, '"aaa","b""bb","ccc"');
fclose($fp);

$fo = new SplFileObject('SplFileObject__fgetcsv8.csv');
try {
    var_dump($fo->fgetcsv(',', '"', 'invalid'));
} catch (ValueError $e) {
    echo $e->getMessage(), "\n";
}
?>
--CLEAN--
<?php
unlink('SplFileObject__fgetcsv8.csv');
?>
--EXPECT--
SplFileObject::fgetcsv(): Argument #3 ($escape) must be empty or a single character