mirror of
https://github.com/php/php-src.git
synced 2024-09-21 09:57:23 +00:00
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:
parent
a706d7302a
commit
d5dd9d59ae
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user