Download src/php/php-src/ext/curl/tests/bug65458.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 616 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/curl/tests/bug65458.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/curl/tests/bug65458.phpt
-
curl -L -o bug65458.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/curl/tests/bug65458.phpt
616 Bytes
| --TEST-- | |
| Bug #65458 (curl memory leak) | |
| --EXTENSIONS-- | |
| curl | |
| --FILE-- | |
| $ch = curl_init(); | |
| $init = memory_get_usage(); | |
| for ($i = 0; $i < 10000; $i++) { | |
| curl_setopt($ch, CURLOPT_HTTPHEADER, [ "SOAPAction: getItems" ]); | |
| } | |
| $preclose = memory_get_usage(); | |
| curl_close($ch); | |
| // This is a slightly tricky heuristic, but basically, we want to ensure | |
| // $preclose - $init has a delta in the order of bytes, not megabytes. Given | |
| // the number of iterations in the loop, if we're wasting memory here, we | |
| // should have megs and megs of extra allocations. | |
| var_dump(($preclose - $init) < 10000); | |
| --EXPECT-- | |
| bool(true) | |