xref: /PHP-7.0/ext/standard/tests/file/bug40501.phpt (revision c269ad91)
1--TEST--
2Bug #40501 (fgetcsv() can't handle trailing odd number of backslashes)
3--FILE--
4<?php
5$file = dirname(__FILE__).'/bug40501.csv';
6
7$h = fopen($file, 'r');
8$data = fgetcsv($h, NULL, ',', '"', '"');
9fclose($h);
10
11var_dump($data);
12?>
13--EXPECTF--
14array(2) {
15  [0]=>
16  string(%d) "this element contains the delimiter, and ends with an odd number of
17backslashes (ex: 1)\"
18  [1]=>
19  string(%d) "and it isn't the last element$"
20}
21