|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53389 $_SERVER['REQUEST_TIME'] is wonky.
Submitted: 2010-11-23 17:14 UTC Modified: 2011-08-05 12:17 UTC
From: Jared dot Williams at ntworld dot com Assigned: iliaa (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: trunk-SVN-2010-11-23 (SVN) OS: Ubuntu 10.10 64bit
Private report: No CVE-ID: None
 [2010-11-23 17:14 UTC] Jared dot Williams at ntworld dot com
$_SERVER['REQUEST_TIME'] seems to fluctuate. 4 runs of 

$_SERVER['REQUEST_TIME']: 4.4291801813059E+17
time(): 1290528694

$_SERVER['REQUEST_TIME']: 4.4291801813268E+17
time(): 1290528708

$_SERVER['REQUEST_TIME']: -3.689152654376E+18
time(): 1290528722

$_SERVER['REQUEST_TIME']: 2.2138054492136E+18
time(): 1290528739

Test script:
	header('Content-Type: text/plain');
	echo "\$_SERVER['REQUEST_TIME']: ", $_SERVER['REQUEST_TIME'], "\ntime(): ", time(), "\n";

Expected result:
$_SERVER['REQUEST_TIME'] to be approximately inline with time()

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-24 15:29 UTC] Jared dot Williams at ntworld dot com
The problem does not appear when using CLI sapi

jared@ubuntu:/var/www/framework.localhost/htdocs$ php -v
PHP 5.3.99-dev (cli) (built: Nov 24 2010 14:20:11)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2010 Zend Technologies
jared@ubuntu:/var/www/framework.localhost/htdocs$ php time.php
$_SERVER['REQUEST_TIME']: 1290608702.0154
time(): 1290608702

However via Apache2

jared@ubuntu:/var/www/framework.localhost/htdocs$ wget -O time.txt 
--2010-11-24 14:28:06--  http://framework.localhost/time.php
Resolving framework.localhost...
Connecting to framework.localhost||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 65 [text/plain]
Saving to: `time.txt'

] 65          --.-
K/s   in 0s

2010-11-24 14:28:06 (6.30 MB/s) - `time.txt' saved [65/65]

jared@ubuntu:/var/www/framework.localhost/htdocs$ cat time.txt
$_SERVER['REQUEST_TIME']: 5.1652845131895E+18
time(): 1290608886
 [2010-12-13 18:28 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: iliaa
 [2010-12-13 18:28 UTC]
Ilia, you changed REQUEST_TIME in trunk, any chance of looking at this one?
 [2011-06-01 12:04 UTC]
-Status: Assigned +Status: Feedback
 [2011-06-01 12:04 UTC]
Please try using this snapshot:
For Windows:

Cannot reproduce it here.
 [2011-08-05 12:17 UTC]
-Status: Feedback +Status: Closed
 [2011-08-05 12:17 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Jan 18 15:01:23 2020 UTC