8000 minor #22086 Release memory for the parsed data after parsing (stof) · symfony/symfony@749451e · GitHub
[go: up one dir, main page]

Skip to content

Commit 749451e

Browse files
committed
minor #22086 Release memory for the parsed data after parsing (stof)
This PR was merged into the 3.3-dev branch. Discussion ---------- Release memory for the parsed data after parsing | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a If the Dotenv instance outlives the parsing of the file (which is the case easily in the usage described in the documentation as it is used in the global scope and so the variable does not go out of scope until the end of the process), there is no reason to keep the parsed data in memory after the end of the parsing. I have not reset the integer properties, as this would not save any memory anyway (integers are inline inside the ZVAL anyway) Commits ------- 518f618 Release memory for the parsed data after parsing
2 parents e75d4be + 518f618 commit 749451e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Symfony/Component/Dotenv/Dotenv.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ public function parse($data, $path = '.env')
121121
return $this->values;
122122
} finally {
123123
$this->values = array();
124+
$this->data = null;
125+
$this->path = null;
124126
}
125127
}
126128

0 commit comments

Comments
 (0)
0