Download src/php/php-src/ext/ftp/tests/dead-resource.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 517 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/ftp/tests/dead-resource.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/ftp/tests/dead-resource.phpt
-
curl -L -o dead-resource.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/ftp/tests/dead-resource.phpt
517 Bytes
| --TEST-- | |
| Attempt to use a closed FTP\Connection | |
| --EXTENSIONS-- | |
| ftp | |
| pcntl | |
| --FILE-- | |
| require 'server.inc'; | |
| $ftp = ftp_connect('127.0.0.1', $port); | |
| if (!$ftp) die("Couldn't connect to the server"); | |
| var_dump(ftp_login($ftp, 'user', 'pass')); | |
| var_dump(ftp_close($ftp)); | |
| try { | |
| var_dump(ftp_login($ftp, 'user', 'pass')); | |
| echo "Login did not throw\n"; | |
| } catch (ValueError $ex) { | |
| echo "Exception: ", $ex->getMessage(), "\n"; | |
| } | |
| --EXPECT-- | |
| bool(true) | |
| bool(true) | |
| Exception: FTP\Connection is already closed | |