Download src/php/php-src/ext/phar/tests/zip/delete.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 758 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/phar/tests/zip/delete.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/phar/tests/zip/delete.phpt
-
curl -L -o delete.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/phar/tests/zip/delete.phpt
758 Bytes
| --TEST-- | |
| Phar: delete test, zip-based phar | |
| --EXTENSIONS-- | |
| phar | |
| --INI-- | |
| phar.readonly=0 | |
| phar.require_hash=0 | |
| --FILE-- | |
| $fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.zip'; | |
| $alias = 'phar://' . $fname; | |
| $file = "<?php | |
| Phar::mapPhar('hio'); | |
| __HALT_COMPILER(); ?>"; | |
| $phar = new Phar($fname); | |
| $phar['a'] = 'a'; | |
| $phar->setStub($file); | |
| $phar->stopBuffering(); | |
| echo file_get_contents($alias . '/a') . "\n"; | |
| $phar->delete('a'); | |
| echo file_get_contents($alias . '/a') . "\n"; | |
| --CLEAN-- | |
| unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.zip'); | |
| --EXPECTF-- | |
| a | |
| Warning: file_get_contents(phar://%sdelete.phar.zip/a): Failed to open stream: phar error: "a" is not a file in phar "%sdelete.phar.zip" in %sdelete.php on line %d | |