Download src/php/php-src/tests/basic/bug80384.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 664 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/tests/basic/bug80384.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/tests/basic/bug80384.phpt
-
curl -L -o bug80384.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/tests/basic/bug80384.phpt
664 Bytes
| --TEST-- | |
| Bug #80384 large reads cause filters to internally buffer large amounts of memory | |
| --FILE-- | |
| /* First, create a file to read */ | |
| $tmp_filename = __DIR__ . "/bug80384.tmp"; | |
| $fp = fopen($tmp_filename, 'w'); | |
| for ($i=0; $i<1024; $i++) { | |
| fwrite($fp, str_repeat('ABCDEFGH', 1024)); | |
| } | |
| fclose($fp); | |
| /* Stream the file through a filter */ | |
| $fp = fopen($tmp_filename, 'r'); | |
| $filter = stream_filter_append($fp, "string.rot13"); | |
| $mem_start = memory_get_usage(); | |
| fread($fp, 8 * 1024 * 1024); | |
| $mem_final = memory_get_usage(); | |
| fclose($fp); | |
| var_dump($mem_final - $mem_start < 32768); | |
| --CLEAN-- | |
| unlink(__DIR__ . "/bug80384.tmp"); | |
| --EXPECT-- | |
| bool(true) | |