fputcsv_002.phpt 564 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --TEST--
  2. fputcsv(): Checking data after calling the function
  3. --FILE--
  4. <?php
  5. $file = dirname(__FILE__) .'/fgetcsv-test.csv';
  6. $data = array(1, 2, 'foo', 'haha', array(4, 5, 6), 1.3, null);
  7. $fp = fopen($file, 'w');
  8. fputcsv($fp, $data);
  9. var_dump($data);
  10. @unlink($file);
  11. ?>
  12. --EXPECTF--
  13. Notice: Array to string conversion in %s on line %d
  14. array(7) {
  15. [0]=>
  16. int(1)
  17. [1]=>
  18. int(2)
  19. [2]=>
  20. string(3) "foo"
  21. [3]=>
  22. string(4) "haha"
  23. [4]=>
  24. array(3) {
  25. [0]=>
  26. int(4)
  27. [1]=>
  28. int(5)
  29. [2]=>
  30. int(6)
  31. }
  32. [5]=>
  33. float(1.3)
  34. [6]=>
  35. NULL
  36. }