bug53848.phpt 407 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Bug #53848 (fgetcsv removes leading spaces from fields)
  3. --FILE--
  4. <?php
  5. $file = __DIR__ . "/bug53848.csv";
  6. @unlink($file);
  7. file_put_contents($file, "a,b\n c, d");
  8. $fp = fopen($file, "r");
  9. while ($l = fgetcsv($fp)) var_dump($l);
  10. fclose($fp);
  11. @unlink($file);
  12. ?>
  13. --EXPECT--
  14. array(2) {
  15. [0]=>
  16. string(1) "a"
  17. [1]=>
  18. string(1) "b"
  19. }
  20. array(2) {
  21. [0]=>
  22. string(3) " c"
  23. [1]=>
  24. string(3) " d"
  25. }