bug22382.phpt 419 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Bug #22382 (fgetcsv() does not handle escaped quotes correctly)
  3. --FILE--
  4. <?php
  5. $fp = fopen(__DIR__."/test2.csv", "r");
  6. while(($line = fgetcsv($fp, 1024))) {
  7. var_dump($line);
  8. }
  9. fclose($fp);
  10. ?>
  11. --EXPECT--
  12. array(6) {
  13. [0]=>
  14. string(3) "One"
  15. [1]=>
  16. string(7) "\"Two\""
  17. [2]=>
  18. string(7) "Three\""
  19. [3]=>
  20. string(4) "Four"
  21. [4]=>
  22. string(2) "\\"
  23. [5]=>
  24. string(28) "\\\\\\\\\\\\\\\\\\\\\\\"\\\\"
  25. }