Skip to content

Commit e7a6ac5

Browse files
authored
Update dotenv.rst
it seems standard practice is to no longer use `getenv()` due to it not being thread safe. symfony/symfony@21a909a Updated the docs to remove reference to that function. Would we want to go so far as to add a note to **not** use `getenv()`?
1 parent a07ad20 commit e7a6ac5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

components/dotenv.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The Dotenv Component
66
====================
77

88
The Dotenv Component parses ``.env`` files to make environment variables
9-
stored in them accessible via ``getenv()``, ``$_ENV`` or ``$_SERVER``.
9+
stored in them accessible via ``$_ENV`` or ``$_SERVER``.
1010

1111
Installation
1212
------------
@@ -53,10 +53,10 @@ Given the following ``.env`` file content:
5353
DB_USER=root
5454
DB_PASS=pass
5555
56-
Access the value with ``getenv()`` in your code::
56+
Access the value with ``$_ENV`` in your code::
5757

58-
$dbUser = getenv('DB_USER');
59-
// you can also use ``$_ENV`` or ``$_SERVER``
58+
$dbUser = $_ENV['DB_USER'];
59+
// you can also use ``$_SERVER``
6060

6161
The ``load()`` method never overwrites existing environment variables. Use the
6262
``overload()`` method if you need to overwrite them::

0 commit comments

Comments
 (0)