bug40501.phpt 419 B

1234567891011121314151617181920
  1. --TEST--
  2. Bug #40501 (fgetcsv() can't handle trailing odd number of backslashes)
  3. --FILE--
  4. <?php
  5. $file = __DIR__.'/bug40501.csv';
  6. $h = fopen($file, 'r');
  7. $data = fgetcsv($h, NULL, ',', '"', '"');
  8. fclose($h);
  9. var_dump($data);
  10. ?>
  11. --EXPECTF--
  12. array(2) {
  13. [0]=>
  14. string(%d) "this element contains the delimiter, and ends with an odd number of
  15. backslashes (ex: 1)\"
  16. [1]=>
  17. string(%d) "and it isn't the last element$"
  18. }