Bug #72646 [Opn->Ver]: SplFileObject::getCsvControl does not return the escape characters
| From: | cmb@php.net | Date: | Fri, 22 Jul 2016 11:59:47 +0000 |
| Subject: | Bug #72646 [Opn->Ver]: SplFileObject::getCsvControl does not return the escape characters | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-202502@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72646&edit=1
ID: 72646
Updated by: cmb@php.net
Reported by: nyamsprod at gmail dot com
Summary: SplFileObject::getCsvControl does not return the
escape characters
-Status: Open
+Status: Verified
Type: Bug
Package: SPL related
Operating System: Irrelevant
PHP Version: Irrelevant
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Confirmed: <https://3v4l.org/XTKF7>. That's
obviously been
forgotten when $escape was added to ::setCSVControl() in PHP 5.3.
The docs need respective updates also.
Previous Comments:
------------------------------------------------------------------------
[2016-07-22 08:10:32] nyamsprod at gmail dot com
Description:
------------
SplFileObject::setCsvControl takes 3 parameters
- the delimiter character
- the enclosure character
- the escape character
But the equivalent SplFileObject::getCsvControl returns an array with only two of those parameters.
The escape character is missing.
Test script:
---------------
<?php
$controls = (new SplTempFileObject())->getCsvControl();
print_r($controls);
Expected result:
----------------
Array
(
[0] => ,
[1] => "
[2] => "\"
)
Actual result:
--------------
Array
(
[0] => ,
[1] => "
)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72646&edit=1