bug66588.phpt 559 B

123456789101112131415161718192021222324252627282930
  1. --TEST--
  2. Bug #66588 SplFileObject::fgetcsv incorrectly returns a row on premature EOF
  3. --DESCRIPTION--
  4. This bug is about the different behavior with and without trailing newline both should behave the same,
  5. and neither should return FALSE.
  6. --FILE--
  7. <?php
  8. $s = fopen("php://memory", "w+");
  9. fwrite($s, "\",bar");
  10. rewind($s);
  11. var_dump(fgetcsv($s));
  12. fclose($s);
  13. $s = fopen("php://memory", "w+");
  14. fwrite($s, "\",bar\n");
  15. rewind($s);
  16. var_dump(fgetcsv($s));
  17. fclose($s);
  18. ?>
  19. --EXPECT--
  20. array(1) {
  21. [0]=>
  22. string(4) ",bar"
  23. }
  24. array(1) {
  25. [0]=>
  26. string(5) ",bar
  27. "
  28. }