mirror of
https://github.com/php/php-src.git
synced 2024-12-03 23:05:57 +08:00
Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts: # ext/spl/spl_directory.c
This commit is contained in:
commit
9a2207c90a
2
NEWS
2
NEWS
@ -63,6 +63,8 @@ PHP NEWS
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #55701 (GlobIterator throws LogicException). (Valentin VĂLCIU)
|
||||
. Fixed bug #72646 (SplFileObject::getCsvControl does not return the escape
|
||||
character). (cmb)
|
||||
|
||||
- SQLite3:
|
||||
. Fixed bug #72571 (SQLite3::bindValue, SQLite3::bindParam crash). (Laruence)
|
||||
|
@ -2657,7 +2657,7 @@ SPL_METHOD(SplFileObject, fputcsv)
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto void SplFileObject::setCsvControl([string delimiter [, string enclosure [, string escape ]]])
|
||||
Set the delimiter and enclosure character used in fgetcsv */
|
||||
Set the delimiter, enclosure and escape character used in fgetcsv */
|
||||
SPL_METHOD(SplFileObject, setCsvControl)
|
||||
{
|
||||
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
|
||||
@ -2700,11 +2700,11 @@ SPL_METHOD(SplFileObject, setCsvControl)
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto array SplFileObject::getCsvControl()
|
||||
Get the delimiter and enclosure character used in fgetcsv */
|
||||
Get the delimiter, enclosure and escape character used in fgetcsv */
|
||||
SPL_METHOD(SplFileObject, getCsvControl)
|
||||
{
|
||||
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
|
||||
char delimiter[2], enclosure[2];
|
||||
char delimiter[2], enclosure[2], escape[2];
|
||||
|
||||
array_init(return_value);
|
||||
|
||||
@ -2712,9 +2712,12 @@ SPL_METHOD(SplFileObject, getCsvControl)
|
||||
delimiter[1] = '\0';
|
||||
enclosure[0] = intern->u.file.enclosure;
|
||||
enclosure[1] = '\0';
|
||||
escape[0] = intern->u.file.escape;
|
||||
escape[1] = '\0';
|
||||
|
||||
add_next_index_string(return_value, delimiter);
|
||||
add_next_index_string(return_value, enclosure);
|
||||
add_next_index_string(return_value, escape);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
@ -6,10 +6,12 @@ $obj = New SplFileObject(dirname(__FILE__).'/SplFileObject_testinput.csv');
|
||||
var_dump($obj->getCsvControl());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(2) {
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
[0]=>
|
||||
%unicode|string%(1) ","
|
||||
string(1) ","
|
||||
[1]=>
|
||||
%unicode|string%(1) """
|
||||
string(1) """
|
||||
[2]=>
|
||||
string(1) "\"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user