From 1cf4ff9d27c91090b368c4d98258e0b475fe0ffd Mon Sep 17 00:00:00 2001 From: narkunan Date: Wed, 19 Nov 2025 15:59:41 +0530 Subject: [PATCH 1/3] Updated doc for csv escape character in fgetcsv function --- reference/filesystem/functions/fgetcsv.xml | 19 +++++++++---------- reference/spl/splfileobject/fgetcsv.xml | 19 +++++++++---------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/reference/filesystem/functions/fgetcsv.xml b/reference/filesystem/functions/fgetcsv.xml index 7e1ba4046dc9..fb4a69ccaf3f 100644 --- a/reference/filesystem/functions/fgetcsv.xml +++ b/reference/filesystem/functions/fgetcsv.xml @@ -88,18 +88,17 @@ It must be a single byte character or the empty string. The empty string ("") disables the proprietary escape mechanism. - + - Usually an enclosure character is escaped inside - a field by doubling it; however, the escape - character can be used as an alternative. So for the default parameter - values "" and \" have the same - meaning. Other than allowing to escape the - enclosure character the - escape character has no special meaning; it isn't - even meant to escape itself. + Inside an enclosure, the enclosure character can always be escaped by doubling it, + resulting in a single enclosure character in the parsed result. + The escaped character works differently: + If it is followed by an enclosure character then that enclosure character will not be treated as one, + however the escaped character itself remains. So for the default parameters, "" + inside an enclosure will be parsed into ", while \" inside an + enclosure will be parsed into \". - + As of PHP 8.4.0, depending on the default value of diff --git a/reference/spl/splfileobject/fgetcsv.xml b/reference/spl/splfileobject/fgetcsv.xml index 7d36981e754f..335638b310ef 100644 --- a/reference/spl/splfileobject/fgetcsv.xml +++ b/reference/spl/splfileobject/fgetcsv.xml @@ -55,18 +55,17 @@ SplFileObject::setCsvControl. An empty string ("") disables the proprietary escape mechanism. - + - Usually an enclosure character is escaped inside - a field by doubling it; however, the escape - character can be used as an alternative. So for the default parameter - values "" and \" have the same - meaning. Other than allowing to escape the - enclosure character the - escape character has no special meaning; it isn't - even meant to escape itself. + Inside an enclosure, the enclosure character can always be escaped by doubling it, + resulting in a single enclosure character in the parsed result. + The escaped character works differently: + If it is followed by an enclosure character then that enclosure character will not be treated as one, + however the escaped character itself remains. So for the default parameters, "" + inside an enclosure will be parsed into ", while \" inside an + enclosure will be parsed into \". - + As of PHP 8.4.0, depending on the default value of From ca71fe8f316bc5d7c9834b2d07455daf396d530e Mon Sep 17 00:00:00 2001 From: narkunan Date: Wed, 19 Nov 2025 16:12:36 +0530 Subject: [PATCH 2/3] Removed trailing white space --- reference/filesystem/functions/fgetcsv.xml | 12 ++++++------ reference/spl/splfileobject/fgetcsv.xml | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/reference/filesystem/functions/fgetcsv.xml b/reference/filesystem/functions/fgetcsv.xml index fb4a69ccaf3f..856f305b70db 100644 --- a/reference/filesystem/functions/fgetcsv.xml +++ b/reference/filesystem/functions/fgetcsv.xml @@ -90,12 +90,12 @@ - Inside an enclosure, the enclosure character can always be escaped by doubling it, - resulting in a single enclosure character in the parsed result. - The escaped character works differently: - If it is followed by an enclosure character then that enclosure character will not be treated as one, - however the escaped character itself remains. So for the default parameters, "" - inside an enclosure will be parsed into ", while \" inside an + Inside an enclosure, the enclosure character can always be escaped by doubling it, + resulting in a single enclosure character in the parsed result. + The escaped character works differently: + If it is followed by an enclosure character then that enclosure character will not be treated as one, + however the escaped character itself remains. So for the default parameters, "" + inside an enclosure will be parsed into ", while \" inside an enclosure will be parsed into \". diff --git a/reference/spl/splfileobject/fgetcsv.xml b/reference/spl/splfileobject/fgetcsv.xml index 335638b310ef..4135ff948325 100644 --- a/reference/spl/splfileobject/fgetcsv.xml +++ b/reference/spl/splfileobject/fgetcsv.xml @@ -57,12 +57,12 @@ - Inside an enclosure, the enclosure character can always be escaped by doubling it, - resulting in a single enclosure character in the parsed result. + Inside an enclosure, the enclosure character can always be escaped by doubling it, + resulting in a single enclosure character in the parsed result. The escaped character works differently: - If it is followed by an enclosure character then that enclosure character will not be treated as one, - however the escaped character itself remains. So for the default parameters, "" - inside an enclosure will be parsed into ", while \" inside an + If it is followed by an enclosure character then that enclosure character will not be treated as one, + however the escaped character itself remains. So for the default parameters, "" + inside an enclosure will be parsed into ", while \" inside an enclosure will be parsed into \". From d0f3e5d183c548c94ffb461dde789a58623960b7 Mon Sep 17 00:00:00 2001 From: narkunan Date: Wed, 19 Nov 2025 16:13:51 +0530 Subject: [PATCH 3/3] Removed trailing whitespace --- reference/spl/splfileobject/fgetcsv.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/spl/splfileobject/fgetcsv.xml b/reference/spl/splfileobject/fgetcsv.xml index 4135ff948325..f149533eb638 100644 --- a/reference/spl/splfileobject/fgetcsv.xml +++ b/reference/spl/splfileobject/fgetcsv.xml @@ -59,7 +59,7 @@ Inside an enclosure, the enclosure character can always be escaped by doubling it, resulting in a single enclosure character in the parsed result. - The escaped character works differently: + The escaped character works differently: If it is followed by an enclosure character then that enclosure character will not be treated as one, however the escaped character itself remains. So for the default parameters, "" inside an enclosure will be parsed into ", while \" inside an