|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2018-11-19 05:46 UTC] admin at yurunsoft dot com
Description:
------------
when I include a file, the file new a anonymous class and return, more and more memory usage
Test script:
---------------
<?php
class A
{
}
file_put_contents(__DIR__ . '/tmp.php', '<?php return new class extends A{};');
while(true)
{
$a = include __DIR__ . '/tmp.php';
usleep(1000);
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 10:00:01 2025 UTC |
you can try this code, it's ok! <?php class A { } while(true) { $a = new class extends A{}; usleep(1000); }Simpler test case: while(true) { $func = eval('return function () {};'); var_dump($func); unset($func); usleep(1000); }