Req #65658 [Com]: microtime is locale aware and not documented as such.
| From: | leight+bugs dot php at gmail dot com | Date: | Thu, 12 Sep 2013 11:12:59 +0000 |
| Subject: | Req #65658 [Com]: microtime is locale aware and not documented as such. | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-10252@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65658&edit=1
ID: 65658
Comment by: leight+bugs dot php at gmail dot com
Reported by: RQuadling at GMail dot com
Summary: microtime is locale aware and not documented as
such.
Status: Open
Type: Feature/Change Request
Package: Documentation problem
Operating System: n/a
PHP Version: 5.4.19
Block user comment: N
Private report: N
New Comment:
Sorry I should have said, using microtime with $get_as_float = true returns a
float/double type, instead of a string.
Previous Comments:
------------------------------------------------------------------------
[2013-09-12 11:09:02] leight+bugs dot php at gmail dot com
microtime() returns a double, not a string. This is not a bug, Printing out a
double type will return it in a locale specific format.
------------------------------------------------------------------------
[2013-09-12 11:01:50] RQuadling at GMail dot com
Description:
------------
microtime(true) returns a locale aware string. This isn't documented.
Test script:
---------------
<?php
echo 'No locale loaded : ', microtime(True), PHP_EOL;
setlocale(LC_ALL, 'fr_FR.UTF-8');
echo 'France locale loaded : ', microtime(True), PHP_EOL;
Expected result:
----------------
No locale loaded : 1378983437.9622
France locale loaded : 1378983437,9626
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65658&edit=1