summaryrefslogtreecommitdiff
path: root/ext/standard/tests/file/bug71882.phpt
blob: 68f98f19b6a842bf5dba88f3462dd05d18ac1455 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
--TEST--
Bug #71882 (Negative ftruncate() on php://memory exhausts memory)
--FILE--
<?php
$fd = fopen("php://memory", "w+");
try {
    var_dump(ftruncate($fd, -1));
} catch (\ValueError $e) {
    echo $e->getMessage() . \PHP_EOL;
}
?>
--EXPECT--
ftruncate(): Argument #2 ($size) must be greater than or equal to 0