PHP 7.4/8.4 | :sparkles: New `PHPCompatibility.ParameterValues.RemovedProprietaryCSVEscaping` sniff by jrfnl · Pull Request #1787 · PHPCompatibility/PHPCompatibility
added 2 commits
October 7, 2024 00:51…Escaping` sniff > - Standard: > . fputcsv() and fgetcsv() now accept an empty string as $escape argument, > which disables the proprietary PHP escaping mechanism. The behavior of > str_getcsv() has been adjusted accordingly (formerly, an empty string was > identical to using the default). This adds a new sniff to detect code subject to this change. The one thing I'm not 100% sure about, is whether this should be an `error` or a `warning`. In PHP 7.3 and lower, passing an empty string as `$escape` to `fputcsv()` and `fgetcsv()` would result in a PHP warning: "Warning: fputcsv(): escape must be a character", not in a fatal error, but as the resulting CSV data can be significantly different - which could break imports/exports, I've elected to make it an error for PHPCompatibility anyway. Refs: * https://wiki.php.net/rfc/kill-csv-escaping (step 1) * https://github.com/php/php-src/blob/004cb827501d1ddaf98daacb185a53e0816f78a7/UPGRADING#L489-L493 * php/php-src 3515 * php/php-src@3b0f051
jrfnl
mentioned this pull request
58 tasks
wimg approved these changes Oct 7, 2024
wimg
deleted the
php-7.4-8.4/new-removedproprietarycsvescaping-sniff
branch
jrfnl
mentioned this pull request
jrfnl
changed the title
PHP 7.4/8.4 | New
PHP 7.4/8.4 | ✨ New PHPCompatibility.ParameterValues.RemovedProprietaryCSVEscaping sniffPHPCompatibility.ParameterValues.RemovedProprietaryCSVEscaping sniff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters