mirror of
https://github.com/php/php-src.git
synced 2026-04-20 22:41:20 +02:00
fputcsv does not terminate lines correctly as per RFC 41801[1]. After adding a new parameter fputcsv may now use a user defined line ending,. In order to maintain backwards compatibility fputcsv() still terminates lines with "\n" by default. Also fixes: #46367[2], #62770[3] Ref: #42357[4] [1] <https://tools.ietf.org/html/rfc4180> [2] <https://bugs.php.net/bug.php?id=46367> [3] <https://bugs.php.net/bug.php?id=62770> [4] <https://bugs.php.net/bug.php?id=42357>
39 lines
677 B
PHP
39 lines
677 B
PHP
--TEST--
|
|
Bug #68479 (Escape parameter missing from SplFileObject::fputcsv)
|
|
--FILE--
|
|
<?php
|
|
|
|
$method = new ReflectionMethod('SplFileObject', 'fputcsv');
|
|
$params = $method->getParameters();
|
|
var_dump($params);
|
|
|
|
?>
|
|
--EXPECT--
|
|
array(5) {
|
|
[0]=>
|
|
object(ReflectionParameter)#2 (1) {
|
|
["name"]=>
|
|
string(6) "fields"
|
|
}
|
|
[1]=>
|
|
object(ReflectionParameter)#3 (1) {
|
|
["name"]=>
|
|
string(9) "separator"
|
|
}
|
|
[2]=>
|
|
object(ReflectionParameter)#4 (1) {
|
|
["name"]=>
|
|
string(9) "enclosure"
|
|
}
|
|
[3]=>
|
|
object(ReflectionParameter)#5 (1) {
|
|
["name"]=>
|
|
string(6) "escape"
|
|
}
|
|
[4]=>
|
|
object(ReflectionParameter)#6 (1) {
|
|
["name"]=>
|
|
string(3) "eol"
|
|
}
|
|
}
|