Skip to content

Fix: Add explicit $escape parameter in fputcsv for PHP 8.4 compatibility #4283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 10, 2024

Conversation

fabyo0
Copy link
Contributor

@fabyo0 fabyo0 commented Dec 9, 2024

This commit resolves a deprecation warning in PHP 8.4 regarding the $escape parameter of the fputcsv function. The warning indicates that the default value for $escape will change in future PHP versions, requiring it to be explicitly provided.

  • Changes Made

Updated the fputcsv calls to include the $escape parameter explicitly with a backslash ('\') as the value.

  • Benefits

Ensures compatibility with PHP 8.4.
Prevents potential future errors caused by the deprecation of the default $escape parameter value.

This update makes the script more robust and ready for future PHP versions.

…cation warning in PHP 8.4

This commit resolves a deprecation warning in PHP 8.4 regarding the $escape parameter of the fputcsv function. The warning indicates that the default value for $escape will change in future PHP versions, requiring it to be explicitly provided.
@Girgias Girgias merged commit 898627b into php:master Dec 10, 2024
2 checks passed
@Girgias
Copy link
Member

Girgias commented Dec 10, 2024

Thank you!

siwa32 added a commit to siwa32/doc-ja that referenced this pull request Jan 13, 2025
KentarouTakeda added a commit to php/doc-ja that referenced this pull request Jan 19, 2025
* PHP 8.4: CSV related changes and deprecations の取り込み

php/doc-en#4093

以下も合わせて取り込む

reference/spl/splfileobject/setcsvcontrol.xml
- [skip-revcheck] Fill xi:fallback to avoid 'variablelist incomplete' in some translations
  - php/doc-en#4128
- Update setcsvcontrol.xml Fix typo
  - php/doc-en#4379

reference/spl/splfileobject/fgetcsv.xml
- Update fgetcsv.xml Remove the duplicate sentence
  - php/doc-en#4111

* Fix GH-4175: do not say the parameters are optional の取り込み

php/doc-en#4177

* Document str_getcsv() and fgetcsv() change in 8.3.0 (closes #4197) の取り込み

php/doc-en#4198

* Fix: Add explicit $escape parameter in fputcsv for PHP 8.4 compatibility の取り込み

php/doc-en#4283

* 改行位置を原文と合わせる対応

---------

Co-authored-by: 武田 憲太郎 <[email protected]>
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