Doc #81508 [NEW]: http_build_query returns empty string given ArrayIterator as input
| From: | mintobit at gmail dot com | Date: | Tue, 05 Oct 2021 15:28:03 +0000 |
| Subject: | Doc #81508 [NEW]: http_build_query returns empty string given ArrayIterator as input | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-19249@lists.php.net to get a copy of this message | ||
From: mintobit at gmail dot com
Operating system: Linux
PHP version: 7.4.24
Package: URL related
Bug Type: Documentation Problem
Bug description:http_build_query returns empty string given ArrayIterator as input
Description:
------------
Have not found anything related here
https://www.php.net/manual/en/migration74.incompatible.php.
Would
appreciate if somebody can explain why this happened: wondering if this
is expected and should be documented.
Test script:
---------------
<?php
$array = [
['ids' => [1,2,3,4]],
['key' => 1]
];
var_dump(http_build_query(new ArrayIterator($array)));
Expected result:
----------------
string(92)
"0%5Bids%5D%5B0%5D=1&0%5Bids%5D%5B1%5D=2&0%5Bids%5D%5B2%5D=3&0%5Bids%5D%5B3%5D=4&1%5Bkey%5D=1"
Actual result:
--------------
string(0) ""
--
Edit bug report at https://bugs.php.net/bug.php?id=81508&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=81508&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=81508&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=81508&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=81508&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=81508&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=81508&r=support
Expected behavior: https://bugs.php.net/fix.php?id=81508&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=81508&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=81508&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=81508&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81508&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=81508&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=81508&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=81508&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=81508&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=81508&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=81508&r=mysqlcfg