summaryrefslogtreecommitdiff
path: root/ext/standard/tests/strings/bug55674.phpt
blob: 72ece642a73df0960796e906648d25c9875fd90e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
--TEST--
Bug #55674 (fgetcsv & str_getcsv skip empty fields in some tab-separated records)
--FILE--
<?php
var_dump(str_getcsv("0\t\t\"2\"\n", "\t"));
var_dump(str_getcsv("0\t \t'2'\n", "\t", "'"));
var_dump(str_getcsv(",,,,"));
var_dump(str_getcsv(" \t  \t\t\t ", "\t"));
?>
--EXPECT--
array(3) {
  [0]=>
  string(1) "0"
  [1]=>
  string(0) ""
  [2]=>
  string(1) "2"
}
array(3) {
  [0]=>
  string(1) "0"
  [1]=>
  string(1) " "
  [2]=>
  string(1) "2"
}
array(5) {
  [0]=>
  string(0) ""
  [1]=>
  string(0) ""
  [2]=>
  string(0) ""
  [3]=>
  string(0) ""
  [4]=>
  string(0) ""
}
array(5) {
  [0]=>
  string(1) " "
  [1]=>
  string(2) "  "
  [2]=>
  string(0) ""
  [3]=>
  string(0) ""
  [4]=>
  string(1) " "
}