php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: Jared dot Williams at ntworld dot com
New email:
PHP Version: OS:

 

 [2010-11-23 17:14 UTC] Jared dot Williams at ntworld dot com
Description:
------------
$_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:
---------------
<?php
	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:
--------------
Wonky.

Patches

Pull Requests

History

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 
http://framework.localhost/time.php
--2010-11-24 14:28:06--  http://framework.localhost/time.php
Resolving framework.localhost... 127.0.0.1
Connecting to framework.localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 65 [text/plain]
Saving to: `time.txt'

100%
[==============================================================================>
] 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
jared@ubuntu:/var/www/framework.localhost/htdocs$
 [2010-12-13 18:28 UTC] kalle@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: iliaa
 [2010-12-13 18:28 UTC] kalle@php.net
Ilia, you changed REQUEST_TIME in trunk, any chance of looking at this one?
 [2011-06-01 12:04 UTC] iliaa@php.net
-Status: Assigned +Status: Feedback
 [2011-06-01 12:04 UTC] iliaa@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

Cannot reproduce it here.
 [2011-08-05 12:17 UTC] iliaa@php.net
-Status: Feedback +Status: Closed
 [2011-08-05 12:17 UTC] iliaa@php.net
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
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 16:01:36 2025 UTC