Closed
Description
Description
With below INI
opcache.enable_cli=1
opcache.jit=1125
opcache.jit_buffer_size=16M
The following code:
<?php
function test() {
$k = 1;
return function () use ($k) {
foo();
};
}
ini_set('memory_limit', '2M');
$array = [];
for ($i = 0; $i < 10_000; $i++) {
$array[] = test();
}
?>
Resulted in this output:
Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 20480 bytes) in /mnt/local/www/index.php on line 5
Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 20480 bytes) in Unknown on line 0
But I expected this output instead:
PHP Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 12288 bytes) in /mnt/local/www/index.php on line 4
PHP Version
PHP master @ 95c8ad2
Operating System
Ubuntu 22.04