Hi,
I propose deprecating SplFileObject CSV methods like fputcsv, fgetcsv, setCsvControl, and getCsvControl.
These APIs are complex and hard to maintain, and named arguments expose design inconsistencies, causing long-standing issues.
We should consider replacing them with a dedicated ext/csv that provides a cleaner, stream-friendly CSV API.
https://github.com/php/php-src/pull/22160
Regards.
Arshid
On Tuesday, 23 June 2026 at 08:53, Muhammed Arshid KV <arshidkv12@gmail.com> wrote:
Hi,
I propose deprecating SplFileObject CSV methods like fputcsv, fgetcsv, setCsvControl, and getCsvControl.
These APIs are complex and hard to maintain, and named arguments expose design inconsistencies, causing long-standing issues.
We should consider replacing them with a dedicated ext/csv that provides a cleaner, stream-friendly CSV API.
ext/spl: Fix default argument handling for named parameters in SplFileObject::fgetcsv() by arshidkv12 · Pull Request #22160 · php/php-src · GitHub
If you provide me with text proposal (ideally in DokuWiki format, but markdown is fine) I'm happy to include it in the bulk RFC.
I will however not be writing it myself.
Best regards,
Gina P. Banyard
On Tue, Jun 23, 2026 at 9:56 AM Muhammed Arshid KV <arshidkv12@gmail.com> wrote:
Hi,
I propose deprecating SplFileObject CSV methods like fputcsv, fgetcsv, setCsvControl, and getCsvControl.
These APIs are complex and hard to maintain, and named arguments expose design inconsistencies, causing long-standing issues.
We should consider replacing them with a dedicated ext/csv that provides a cleaner, stream-friendly CSV API.
https://github.com/php/php-src/pull/22160
Regards.
Arshid
Hi Arshid,
While I agree that CSV handling can and should be improved in core PHP, deprecating the current API without providing at least the start of a replacement API seems premature to me.
We should first focus on providing a better/improved CSV experience in PHP. Then, if:
- we all agree on a new API
- everyone starts using it and it becomes popular
- and the path to migrate to the new API is made as straightforward as possible
then we can start discussing the process of deprecating the current feature. Anything else would be counterproductive at the moment.
Best regards,
Ignace
On Tue, Jun 23, 2026 at 8:36 AM ignace nyamagana butera <nyamsprod@gmail.com> wrote:
On Tue, Jun 23, 2026 at 9:56 AM Muhammed Arshid KV <arshidkv12@gmail.com> wrote:
Hi,
I propose deprecating SplFileObject CSV methods like fputcsv, fgetcsv, setCsvControl, and getCsvControl.
These APIs are complex and hard to maintain, and named arguments expose design inconsistencies, causing long-standing issues.
We should consider replacing them with a dedicated ext/csv that provides a cleaner, stream-friendly CSV API.
https://github.com/php/php-src/pull/22160
Regards.
Arshid
Hi Arshid,
While I agree that CSV handling can and should be improved in core PHP, deprecating the current API without providing at least the start of a replacement API seems premature to me.
We should first focus on providing a better/improved CSV experience in PHP. Then, if:
- we all agree on a new API
- everyone starts using it and it becomes popular
- and the path to migrate to the new API is made as straightforward as possible
then we can start discussing the process of deprecating the current feature. Anything else would be counterproductive at the moment.
Best regards,
Ignace
Can we deprecate the error suppression operator?
(Not a serious suggestion - just trying to elicit a laugh - ok, ok, I’ll go back to the dunce corner.)