Speed up test case

This test case did 100,000 includes of a non existing file to show the
memory leak; this is not necessary, because after the first failing
include, memory is not supposed to increase for further includes.

Closes GH-7088.
This commit is contained in:
Christoph M. Becker 2021-06-02 19:54:52 +02:00
parent a706d7302a
commit d5dd9d59ae
No known key found for this signature in database
GPG Key ID: D66C9593118BCCB6

View File

@ -2,12 +2,13 @@
Bug #79514 (Memory leaks while including unexistent file)
--FILE--
<?php
$mem1 = memory_get_usage(true);
for ($i = 0; $i < 100000; $i++) {
@include __DIR__ . '/bug79514.doesnotexist';
}
$mem2 = memory_get_usage(true);
var_dump($mem2 - $mem1 < 100000);
$filename = __DIR__ . '/bug79514.doesnotexist';
@include $filename;
// Further include should not increase memory usage.
$mem1 = memory_get_usage();
@include $filename;
$mem2 = memory_get_usage();
var_dump($mem1 == $mem2);
?>
--EXPECT--
bool(true)