We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7843ef7 + 37f67a9 commit e5b3e37Copy full SHA for e5b3e37
ext/standard/http.c
@@ -226,7 +226,7 @@ PHP_FUNCTION(http_build_query)
226
Z_PARAM_ARRAY_OR_OBJECT(formdata)
227
Z_PARAM_OPTIONAL
228
Z_PARAM_STRING(prefix, prefix_len)
229
- Z_PARAM_STR(arg_sep)
+ Z_PARAM_STR_OR_NULL(arg_sep)
230
Z_PARAM_LONG(enc_type)
231
ZEND_PARSE_PARAMETERS_END();
232
ext/standard/tests/http/http_build_query/gh12745.phpt
@@ -0,0 +1,17 @@
1
+--TEST--
2
+Bug GH-9316 (http_build_query() default null argument for $arg_separator is implicitly coerced to string)
3
+--FILE--
4
+<?php
5
+
6
+$data = [
7
+ 'hello' => 'world',
8
+ 'foo' => 'bar',
9
+];
10
11
+var_dump(http_build_query(
12
+ $data,
13
+ encoding_type: PHP_QUERY_RFC3986
14
+));
15
+?>
16
+--EXPECT--
17
+string(19) "hello=world&foo=bar"
0 commit comments