From: Patrick Allaert Date: Fri, 6 Jan 2012 13:38:06 +0000 (+0000) Subject: Changed: restoring REQUEST_TIME as a long, introducing REQUEST_TIME_FLOAT instead... X-Git-Tag: php-5.4.0RC6~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b1721549dd8b5a4f6d4de7b1853141b65688c475;p=php Changed: restoring REQUEST_TIME as a long, introducing REQUEST_TIME_FLOAT instead as discussed on the ML --- diff --git a/NEWS b/NEWS index d6d70186a5..7a084519a5 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? Jan 2012, PHP 5.4.0 RC6 +- Core: + . Restoring $_SERVER['REQUEST_TIME'] as a long and introducing + $_SERVER['REQUEST_TIME_FLOAT'] to include microsecond precision. (Patrick) + 07 Jan 2012, PHP 5.4.0 RC5 - Core: . Fixed bug #60613 (Segmentation fault with $cls->{expr}() syntax). (Dmitry) diff --git a/main/php_variables.c b/main/php_variables.c index 1ab7ad0259..5f779f991c 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -581,10 +581,13 @@ static inline void php_register_server_variables(TSRMLS_D) } /* store request init time */ { - zval new_entry; - Z_TYPE(new_entry) = IS_DOUBLE; - Z_DVAL(new_entry) = sapi_get_request_time(TSRMLS_C); - php_register_variable_ex("REQUEST_TIME", &new_entry, array_ptr TSRMLS_CC); + zval request_time_float, request_time_long; + Z_TYPE(request_time_float) = IS_DOUBLE; + Z_DVAL(request_time_float) = sapi_get_request_time(TSRMLS_C); + php_register_variable_ex("REQUEST_TIME_FLOAT", &request_time_float, array_ptr TSRMLS_CC); + Z_TYPE(request_time_long) = IS_LONG; + Z_LVAL(request_time_long) = zend_dval_to_lval(Z_DVAL(request_time_float)); + php_register_variable_ex("REQUEST_TIME", &request_time_long, array_ptr TSRMLS_CC); } }