summaryrefslogtreecommitdiff
path: root/main/php_variables.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/php_variables.c')
-rw-r--r--main/php_variables.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/main/php_variables.c b/main/php_variables.c
index 1a40c2a19f..6fb6ca000d 100644
--- a/main/php_variables.c
+++ b/main/php_variables.c
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -573,21 +571,15 @@ static zend_always_inline void import_environment_variable(HashTable *ht, char *
void _php_import_environment_variables(zval *array_ptr)
{
-#ifndef PHP_WIN32
- char **env;
-#else
- char *environment, *env;
-#endif
-
tsrm_env_lock();
#ifndef PHP_WIN32
- for (env = environ; env != NULL && *env != NULL; env++) {
+ for (char **env = environ; env != NULL && *env != NULL; env++) {
import_environment_variable(Z_ARRVAL_P(array_ptr), *env);
}
#else
- environment = GetEnvironmentStringsA();
- for (env = environment; env != NULL && *env; env += strlen(env) + 1) {
+ char *environment = GetEnvironmentStringsA();
+ for (char *env = environment; env != NULL && *env; env += strlen(env) + 1) {
import_environment_variable(Z_ARRVAL_P(array_ptr), env);
}
FreeEnvironmentStringsA(environment);