[php-src] Issue #9009: fputcsv and fgetcsv with default arguments are not consistent
| From: | ebaranauskas | Date: | Thu, 14 Jul 2022 05:35:50 +0000 |
| Subject: | [php-src] Issue #9009: fputcsv and fgetcsv with default arguments are not consistent | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-241925@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/9009
Author: ebaranauskas
### Description
The following code:
```php
<?php
$data = ['"\\'];
print_r($data);
$temp = tmpfile();
fputcsv($temp, $data);
fseek($temp, 0);
print_r(fgetcsv($temp));
fclose($temp);
```
Resulted in this output:
```
Array
(
[0] => "\
)
Array
(
[0] => "\"
)
```
But I expected this output instead:
```
Array
(
[0] => "\
)
Array
(
[0] => "\
)
```
### PHP Version
7.4
### Operating System
Ubuntu 20.04