Download src/php/php-src/sapi/cli/tests/021.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 814 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/sapi/cli/tests/021.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/sapi/cli/tests/021.phpt
-
curl -L -o 021.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/sapi/cli/tests/021.phpt
814 Bytes
| --TEST-- | |
| CLI shell shebang | |
| --SKIPIF-- | |
| include 'skipif.inc'; | |
| if (substr(PHP_OS, 0, 3) == 'WIN') { | |
| die ("skip not for Windows"); | |
| } | |
| if (str_contains(getenv('TEST_PHP_EXECUTABLE'), " ")) { | |
| die("skip shebang cannot have spaces in its path"); | |
| } | |
| if (strlen("#!".getenv('TEST_PHP_EXECUTABLE')) > 127) { | |
| die ("skip shebang is too long, see http://www.in-ulm.de/~mascheck/various/shebang/#results"); | |
| } | |
| --FILE-- | |
| $php = getenv('TEST_PHP_EXECUTABLE'); | |
| $filename = __DIR__.'/021.tmp.php'; | |
| $script = "#!$php -n\n". | |
| "ola\n". | |
| "<?php echo 1+1,'\n';\n". | |
| "?>\n". | |
| "adeus\n"; | |
| file_put_contents($filename, $script); | |
| chmod($filename, 0777); | |
| echo `$filename`; | |
| echo "\nDone\n"; | |
| --CLEAN-- | |
| unlink(__DIR__.'/021.tmp.php'); | |
| --EXPECT-- | |
| ola | |
| 2 | |
| adeus | |
| Done | |