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