Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SERVER['REQUEST_TIME'] vs SERVER['REQUEST_TIME_FLOAT'] #10

Closed
mbischof opened this issue Sep 19, 2013 · 1 comment
Closed

SERVER['REQUEST_TIME'] vs SERVER['REQUEST_TIME_FLOAT'] #10

mbischof opened this issue Sep 19, 2013 · 1 comment

Comments

@mbischof
Copy link
Contributor

PHP_TIMER requires php version gt 5.3.3
$_SERVER['REQUEST_TIME_FLOAT'] is available since php version 5.4.0

so, if SERVER['REQUEST_TIME_FLOAT'] is not available use SERVER['REQUEST_TIME']

@sebastianbergmann
Copy link
Owner

You mean like this

diff --git a/PHP/Timer.php b/PHP/Timer.php
index 0056ea8..5f62445 100644
--- a/PHP/Timer.php
+++ b/PHP/Timer.php
@@ -143,6 +143,10 @@ public static function resourceUsage()
     PHP_Timer::$requestTime = $_SERVER['REQUEST_TIME_FLOAT'];
 }

+else if (isset($_SERVER['REQUEST_TIME'])) {
+    PHP_Timer::$requestTime = $_SERVER['REQUEST_TIME'];
+}
+
 else {
     PHP_Timer::$requestTime = microtime(TRUE);
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants