diff options
author | Anatol Belski <ab@php.net> | 2015-07-31 14:02:03 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2015-07-31 19:09:37 +0200 |
commit | 3a66a23679487f4feda699ada109ab2b675e9474 (patch) | |
tree | 41b3d80bd3b34e6db1516d9600bbdb7d4821f2e2 /main/php_variables.c | |
parent | 7be9e69eafdb1828d09daecde5cd39112db3f581 (diff) | |
download | php-git-3a66a23679487f4feda699ada109ab2b675e9474.tar.gz |
avoid unnecessary scoping
Diffstat (limited to 'main/php_variables.c')
-rw-r--r-- | main/php_variables.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/main/php_variables.c b/main/php_variables.c index ebc060bb1b..173d6b075d 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -592,6 +592,8 @@ PHPAPI void php_build_argv(char *s, zval *track_vars_array) */ static inline void php_register_server_variables(void) { + zval request_time_float, request_time_long; + zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_SERVER]); array_init(&PG(http_globals)[TRACK_VARS_SERVER]); @@ -610,15 +612,12 @@ static inline void php_register_server_variables(void) if (SG(request_info).auth_digest) { php_register_variable("PHP_AUTH_DIGEST", SG(request_info).auth_digest, &PG(http_globals)[TRACK_VARS_SERVER]); } - /* store request init time */ - { - zval request_time_float, request_time_long; - ZVAL_DOUBLE(&request_time_float, sapi_get_request_time()); - php_register_variable_ex("REQUEST_TIME_FLOAT", &request_time_float, &PG(http_globals)[TRACK_VARS_SERVER]); - ZVAL_LONG(&request_time_long, zend_dval_to_lval(Z_DVAL(request_time_float))); - php_register_variable_ex("REQUEST_TIME", &request_time_long, &PG(http_globals)[TRACK_VARS_SERVER]); - } + /* store request init time */ + ZVAL_DOUBLE(&request_time_float, sapi_get_request_time()); + php_register_variable_ex("REQUEST_TIME_FLOAT", &request_time_float, &PG(http_globals)[TRACK_VARS_SERVER]); + ZVAL_LONG(&request_time_long, zend_dval_to_lval(Z_DVAL(request_time_float))); + php_register_variable_ex("REQUEST_TIME", &request_time_long, &PG(http_globals)[TRACK_VARS_SERVER]); } /* }}} */ |