|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40009 http_build_query(array()) returns NULL, not empty string
Submitted: 2007-01-03 11:24 UTC Modified: 2007-01-03 23:17 UTC
From: bugs dot php dot net at chsc dot dk Assigned:
Status: Closed Package: URL related
PHP Version: 5.2.0 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
40 + 37 = ?
Subscribe to this entry?

 [2007-01-03 11:24 UTC] bugs dot php dot net at chsc dot dk
http_build_query(array()) returns NULL. According to the documentation, the return type of http_build_query is string.

This can be considered a documentation problem, but I think it would be better to change the function so that it always returns a string.

Reproduce code:
./php.exe -r "echo gettype(http_build_query(array()));"

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-03 23:17 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Sep 25 22:01:24 2023 UTC