Skip to content

Commit

Permalink
Changed: restoring REQUEST_TIME as a long, introducing REQUEST_TIME_F…
Browse files Browse the repository at this point in the history
…LOAT instead as discussed on the ML
  • Loading branch information
patrickallaert committed Jan 6, 2012
1 parent 64a9019 commit b172154
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions NEWS
Expand Up @@ -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)
Expand Down
11 changes: 7 additions & 4 deletions main/php_variables.c
Expand Up @@ -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);
}

}
Expand Down

0 comments on commit b172154

Please sign in to comment.