Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f756b96

Browse files
authoredSep 13, 2024··
Make CSV deprecation less annoying to deal with (#15569)
1 parent e73a855 commit f756b96

File tree

88 files changed

+408
-341
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+408
-341
lines changed
 

‎UPGRADING

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -581,11 +581,11 @@ PHP 8.4 UPGRADE NOTES
581581
- SPL:
582582
. The SplFixedArray::__wakeup() method has been deprecated as it implements
583583
__serialize() and __unserialize() which need to be overwritten instead.
584-
. Passing a non-empty string for the $enclosure parameter of:
584+
. Using the default value for $escape parameter of:
585585
- SplFileObject::setCsvControl()
586586
- SplFileObject::fputcsv()
587587
- SplFileObject::fgetcsv()
588-
is now deprecated.
588+
is now deprecated. It must be passed explicitly either positionally or via named arguments.
589589
RFC: https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_proprietary_csv_escaping_mechanism
590590

591591
- Standard:
@@ -595,11 +595,11 @@ PHP 8.4 UPGRADE NOTES
595595
RFC: https://wiki.php.net/rfc/raising_zero_to_power_of_negative_number
596596
. Unserializing strings using the uppercase 'S' tag is deprecated.
597597
RFC: https://wiki.php.net/rfc/deprecations_php_8_4#unserialize_s_s_tag
598-
. Passing a non-empty string for the $enclosure parameter of:
598+
. Using the default value for $escape parameter of:
599599
- fputcsv()
600600
- fgetcsv()
601601
- str_getcsv()
602-
is now deprecated.
602+
is now deprecated. It must be passed explicitly either positionally or via named arguments.
603603
RFC: https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_proprietary_csv_escaping_mechanism
604604

605605
- XML:

‎ext/phar/tests/phar_oo_008.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class MyCSVFile extends SplFileObject
3333
{
3434
function current(): array|false
3535
{
36-
return parent::fgetcsv(',', '"');
36+
return parent::fgetcsv(',', '"', escape: '');
3737
}
3838
}
3939

@@ -44,14 +44,14 @@ $v = $phar['a.csv'];
4444
echo "===3===\n";
4545
while(!$v->eof())
4646
{
47-
echo $v->key() . "=>" . join('|', $v->fgetcsv()) . "\n";
47+
echo $v->key() . "=>" . join('|', $v->fgetcsv(escape: '')) . "\n";
4848
}
4949

5050
echo "===4===\n";
5151
$v->rewind();
5252
while(!$v->eof())
5353
{
54-
$l = $v->fgetcsv();
54+
$l = $v->fgetcsv(escape: '');
5555
echo $v->key() . "=>" . join('|', $l) . "\n";
5656
}
5757

@@ -66,7 +66,7 @@ class MyCSVFile2 extends SplFileObject
6666
function getCurrentLine(): string
6767
{
6868
echo __METHOD__ . "\n";
69-
return implode('|', parent::fgetcsv(',', '"'));
69+
return implode('|', parent::fgetcsv(',', '"', escape: ''));
7070
}
7171
}
7272

0 commit comments

Comments
 (0)
Please sign in to comment.