diff --git a/README.md b/README.md index c89992b0..e5f3c701 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,10 @@ composer require league/csv:^9.0 ## Configuration +> [!WARNING] +> **Starting with PHP8.4 Deprecation notices will be trigger if you do not explicitly use the empty string as the escape parameter.** +> see [Deprecation for PHP8.4](https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_proprietary_csv_escaping_mechanism) and [CSV and PHP8.4](https://nyamsprod.com/blog/csv-and-php8-4/) + > [!TIP] > If your CSV document was created or is read on a **Legacy Macintosh computer**, add the following lines before using the library to help [PHP detect line ending](http://php.net/manual/en/function.fgetcsv.php#refsect1-function.fgetcsv-returnvalues). diff --git a/docs/9.0/connections/controls.md b/docs/9.0/connections/controls.md index 30e9054b..7b7ef503 100644 --- a/docs/9.0/connections/controls.md +++ b/docs/9.0/connections/controls.md @@ -55,7 +55,14 @@ $enclosure = $csv->getEnclosure(); //returns "|" ## The escape character -This is a PHP specific control character which sometimes interferes with CSV parsing and writing. It is recommended in versions preceding `9.2.0` to never change its default value unless you do understand its usage and its consequences. +This is a PHP specific control character which sometimes interferes with CSV parsing and writing. +It is recommended in versions preceding `9.2.0` to never change its default value unless you do understand its usage and its consequences. + +

Starting with version PHP8.4 using this method with +anything other than the empty string will trigger a PHP deprecation notice! +see Deprecation for PHP8.4 and +CSV and PHP8.4 for more information. +

### Description @@ -75,9 +82,7 @@ $escape = $csv->getEscape(); //returns "\" ```

The default escape character is \.

-

Since version 9.2.0 you can provide an empty string for the escape character to enable better RFC4180 compliance.

-

setEscape will throw a Exception exception if the submitted string length is not equal to 1 byte or an empty string.

```php