note 123833 added to function.getenv
| From: | Anonymous@php.net | Date: | Thu, 09 May 2019 14:07:03 +0000 |
| Subject: | note 123833 added to function.getenv | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-210995@lists.php.net to get a copy of this message | ||
It is worth noting that since getenv('MY_VARIABLE') will return false when the variable
given is not set, there is no direct way to distinguish between a variable that is unset and one
that is explicitly set to the value bool(false) when using getenv().
This makes it somewhat tricky to have boolean environment variables default to true if unset, which
you can work around either by using "falsy" values such as 0 with the strict comparison
operators or by using the superglobal arrays and isset().
----
Server IP: 208.43.231.9
Probable Submitter: 185.85.3.142 (proxied: 193.219.102.243)
----
Manual Page -- http://php.net/manual/en/function.getenv.php
Edit -- https://master.php.net/note/edit/123833
Del: integrated -- https://master.php.net/note/delete/123833/integrated
Del: useless -- https://master.php.net/note/delete/123833/useless
Del: bad code -- https://master.php.net/note/delete/123833/bad+code
Del: spam -- https://master.php.net/note/delete/123833/spam
Del: non-english -- https://master.php.net/note/delete/123833/non-english
Del: in docs -- https://master.php.net/note/delete/123833/in+docs
Del: other reasons-- https://master.php.net/note/delete/123833
Reject -- https://master.php.net/note/reject/123833
Search -- https://master.php.net/manage/user-notes.php