|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59146 Wrong return value of HttpMessage::getHttpVersion()
Submitted: 2010-04-05 17:51 UTC Modified: 2010-04-28 02:39 UTC
From: jan at horde dot org Assigned: mike (profile)
Status: Closed Package: pecl_http (PECL)
PHP Version: 5.3.2RC3 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: jan at horde dot org
New email:
PHP Version: OS:


 [2010-04-05 17:51 UTC] jan at horde dot org
HttpMessage::getHttpVersion() returns a string instead a float. This would be fine, if the string was actually a string representation of the version float. But the string is locale dependent.
The method should either return a float, or cast to string locale-independently.

Reproduce code:
setlocale(LC_ALL, "de_DE");
$h = new HttpRequest("");
echo $h->getResponseMessage()->getHttpVersion();

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-27 09:45 UTC]
Thank you for taking the time to write to us, but this is not
a bug.

This is PHP's behaviour and not pecl_http's.

As you set the locale to de_DE (where decimal separator is a comma) PHP prints the returned float as "1,1".

Use number_format() to display decimal values as you desire or do not use POSIX locales.
 [2010-04-27 09:47 UTC]
Dammit, I actually should read the bug report thouroughly.

 [2010-04-28 02:39 UTC]
This bug has been fixed in SVN.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on

In case this was a website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PECL better.

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Oct 02 06:05:52 2022 UTC