From: Operating system: All PHP version: 5.3.8 Package: Filesystem function related Bug Type: Bug Bug description:fgetcsv ignores empty columns
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 bug report at https://bugs.php.net/bug.php?id=60121&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60121&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60121&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60121&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60121&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60121&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60121&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60121&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60121&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60121&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60121&r=support Expected behavior: https://bugs.php.net/fix.php?id=60121&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60121&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60121&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60121&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60121&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=60121&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60121&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60121&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60121&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60121&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60121&r=mysqlcfg