Commit cfd86c8
Fix fputcsv fields parameter (should be string[])
The `fields` parameter for `fputcsv` should be an array of strings. See [PHP manual](https://www.php.net/manual/en/function.fputcsv.php).
This should fix [this snippet](https://phpstan.org/r/65420d60-d1fd-4eef-9ba3-e057672082ee) by correctly reporting an error on line `22`.
Running the code in the snippet on PHP 8.0 (`PHP 8.0.0 (cli) (built: Dec 6 2020 06:56:11) ( NTS )`) results in this error:
```
PHP Fatal error: Uncaught Error: Object of class Person could not be converted to string in /home/vagrant/example/csv.php:24
Stack trace:
#0 /home/vagrant/example/csv.php(24): fputcsv()
#1 {main}
thrown in /home/vagrant/example/csv.php on line 24
```
NOTE: I've seen a similar error with PHP 7.3 too.1 parent 68d1399 commit cfd86c8
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3004 | 3004 | | |
3005 | 3005 | | |
3006 | 3006 | | |
3007 | | - | |
| 3007 | + | |
3008 | 3008 | | |
3009 | 3009 | | |
3010 | 3010 | | |
| |||
0 commit comments