I wanted to point out that the current documentation for fputcsv() is outdated. Starting with PHP 8.2, the $escape parameter must be explicitly provided, as its default value will change in future versions. Failing to specify it will trigger a warning.
Example of the correct usage in PHP 8.2+:
fputcsv($handle, $fields, ",", '"', "\\");
It would be helpful if the documentation is updated to reflect this change, so developers are aware that all parameters need to be specified explicitly in PHP 8.2 and later.