8000 bug #11200 Update dotenv.rst (browner12) · symfony/symfony-docs@df44e6f · GitHub
[go: up one dir, main page]

Skip to content

Commit df44e6f

Browse files
committed
bug #11200 Update dotenv.rst (browner12)
This PR was submitted for the 4.2 branch but it was merged into the 3.4 branch instead (closes #11200). Discussion ---------- Update dotenv.rst it seems standard practice is to 8000 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()`? Commits ------- 5be35bf Update dotenv.rst
2 parents dbc77f5 + 5be35bf commit df44e6f

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
.. versionadded:: 3.3
1212

@@ -55,10 +55,10 @@ Given the following ``.env`` file content:
5555
DB_USER=root
5656
DB_PASS=pass
5757
58-
Access the value with ``getenv()`` in your code::
58+
Access the value with ``$_ENV`` in your code::
5959

60-
$dbUser = getenv('DB_USER');
61-
// you can also use ``$_ENV`` or ``$_SERVER``
60+
$dbUser = $_ENV['DB_USER'];
61+
// you can also use ``$_SERVER``
6262

6363
.. note::
6464

0 commit comments

Comments
 (0)
0