php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49023 http_build_query() truncates 64-bit integers
Submitted: 2009-07-22 22:21 UTC Modified: 2009-07-27 08:12 UTC
Votes:2
Avg. Score:3.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: thedazedsmart1 at yahoo dot ca Assigned:
Status: Not a bug Package: URL related
PHP Version: 5.2.10 OS: Unbuntu
Private report: No CVE-ID: None
 [2009-07-22 22:21 UTC] thedazedsmart1 at yahoo dot ca
Description:
------------
http_build_query doesn't handle 64-bit integers even on 64-bit systems, truncates to 12 digits only.

Reproduce code:
---------------
---
From manual page: function.http-build-query
---

$args = array("test" => 100000012859481);
$output = http_build_query($args);
var_dump($output);

Expected result:
----------------
string(17) "test=100000012859481"


Actual result:
--------------
string(17) "test=100000012859"


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-26 14:53 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Pass the value as a string or as a float. The truncation is actually 
done by PHP, during array creation, not by the http_build_query() 
function.
 [2009-07-27 08:12 UTC] thedazedsmart1 at yahoo dot ca
Can you please produce the line in documentation explaining your statement? I can find no mention of sensitivity to the types used in the formdata parameter.

formdata: "[m]ay be an array or object containing properties.")
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 05:01:30 2024 UTC