PHP 8.5.0 Alpha 4 available for testing

Voting

: five minus zero?
(Example: nine)

The Note You're Voting On

aasasdasdf at yandex dot ru
11 years ago
Please note that writing to $_ENV does not actually set an environment variable, i.e. the variable will not propagate to any child processes you launch (except forked script processes, in which case it's just a variable in the script's memory). To set real environment variables, you must use putenv().

Basically, setting a variable in $_ENV does not have any meaning besides setting or overriding a script-wide global variable. Thus, one should never modify $_ENV except for testing purposes (and then be careful to use putenv() too, if appropriate).

PHP will not trigger any kind of error or notice when writing to $_ENV.

<< Back to user notes page

To Top