[php-src] Issue #8078: `eval` is leaking memory
| From: | mvorisek | Date: | Fri, 11 Feb 2022 10:28:18 +0000 |
| Subject: | [php-src] Issue #8078: `eval` is leaking memory | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-239653@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8078
Author: mvorisek
### Description
The following code:
```php
<?php
$m = memory_get_usage();
for ($i = 0; $i < 1000; $i++) {
$fn = eval('return function ($foo) {};');
//$fn = function ($foo) {};
var_dump(memory_get_usage() - $m);
}
```
Resulted in this output:
```
int(640)
int(672)
int(672)
int(672)
...
int(197280)
```
But I expected this output instead:
```
int(640)
int(672)
int(672)
int(672)
...
int(672)
```
### PHP Version
8.1.x
### Operating System
any