Edit report at https://bugs.php.net/bug.php?id=60121&edit=1
ID: 60121 Updated by: larue...@php.net Reported by: roborg at hotmail dot com Summary: fgetcsv ignores empty columns -Status: Open +Status: Closed Type: Bug Package: Filesystem function related Operating System: All PHP Version: 5.3.8 -Assigned To: +Assigned To: laruence Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. see #55674, this has been fixed Previous Comments: ------------------------------------------------------------------------ [2011-10-24 14:43:36] roborg at hotmail dot com Description: ------------ The patch to bug #53848 has broken fgetcsv when it reads "empty" fields and an enclosure is used. Before this patch, the actual result was the same as the expected result. Test script: --------------- print_r(str_getcsv("1\t2\t3", "\t", "'")); // This works print_r(str_getcsv("1\t\t3", "\t", "")); // This works print_r(str_getcsv("'1'\t\t'3'", "\t", "'")); // This one is broken (used to work) Expected result: ---------------- Array ( [0] => 1 [1] => 2 [2] => 3 ) Array ( [0] => 1 [1] => [2] => 3 ) Array ( [0] => 1 [1] => [2] => 3 ) Actual result: -------------- Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 3 ) Array ( [0] => 1 [1] => [2] => 3 ) Array ( [0] => 1 [1] => 3 ) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60121&edit=1