Doc #73270 [Asn->Fbk]: php.ini says wrong default settings for arg_separator.output

From: Date: Mon, 28 Nov 2016 18:59:35 +0000
Subject: Doc #73270 [Asn->Fbk]: php.ini says wrong default settings for arg_separator.output
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-14153@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73270&edit=1 ID: 73270 Updated by: peehaa@php.net Reported by: labs at undef dot name Summary: php.ini says wrong default settings for arg_separator.output -Status: Assigned +Status: Feedback Type: Documentation Problem Package: Documentation problem Operating System: Linux PHP Version: 7.0.11 Assigned To: peehaa Block user comment: N Private report: N New Comment: > So "&" should the default setting, but the result of http_build_query() is with > "&". I cannot reproduce this: https://3v4l.org/8JfYE > If i set "arg_separator.output" to "&" or '&' in the > php.ini, then i also get "&" with http_build_query(). > ini_get('arg_separator.output') also returns "&" then. Again no repro: https://3v4l.org/gCrMb I *do* expect the default value correctly in the ini files though so arg_separator.output = "&" instead of arg_separator.output = "&". Previous Comments: ------------------------------------------------------------------------ [2016-10-09 11:54:58] labs at undef dot name Description: ------------ --- From manual page: http://www.php.net/function.http-build-query --- The php.ini file says: ; The separator used in PHP generated URLs to separate arguments. ; PHP's default setting is "&". ; http://php.net/arg-separator.output ; Example: ;arg_separator.output = "&" So "&" should the default setting, but the result of http_build_query() is with "&". $data = array( 'secret' => 'value_secret', 'response' => 'value_response', ); echo http_build_query($data) ."\n"; Results into "secret=value_secret&response=value_response" echo http_build_query($data, null, '&') ."\n"; Results into "secret=value_secret&response=value_response". Also the phpinfo() function output for "arg_separator.output" is "&" but is displayed in the generated HTML-Page as simple "&" which is confusing. This is also at the default php.ini settings at "arg_separator.input". -------- If i set "arg_separator.output" to "&" or '&' in the php.ini, then i also get "&" with http_build_query(). ini_get('arg_separator.output') also returns "&" then. Test script: --------------- $data = array( 'secret' => 'value_secret', 'response' => 'value_response', ); echo ini_get('arg_separator.output') ."\n"; echo http_build_query($data) ."\n"; echo http_build_query($data, null, '&') ."\n"; ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73270&edit=1

« previous php.doc.bugs (#14153) next »