Skip to content

Conversation

@szepeviktor
Copy link
Contributor

plus inserting a space

plus inserting a space
@ondrejmirtes
Copy link
Member

Thanks!

@ondrejmirtes ondrejmirtes merged commit e68c6e7 into phpstan:master Nov 3, 2019
@szepeviktor
Copy link
Contributor Author

You're welcome.

@szepeviktor szepeviktor deleted the patch-1 branch November 3, 2019 18:45
DaveLiddament added a commit to DaveLiddament/phpstan-src that referenced this pull request Feb 15, 2021
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()
phpstan#1 {main}
  thrown in /home/vagrant/example/csv.php on line 24
```

NOTE: I've seen  a similar error with PHP 7.3 too.
ondrejmirtes pushed a commit that referenced this pull request Feb 15, 2021
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.
niconoe- added a commit to niconoe-/phpstan-src that referenced this pull request Jul 8, 2021
@staabm staabm mentioned this pull request Jul 17, 2022
1 task
@staabm staabm mentioned this pull request Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants