Download src/php/php-src/tests/output/ob_start_basic_002.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 915 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/tests/output/ob_start_basic_002.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/tests/output/ob_start_basic_002.phpt
-
curl -L -o ob_start_basic_002.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/tests/output/ob_start_basic_002.phpt
915 Bytes
| --TEST-- | |
| ob_start(): Check behaviour with various callback return values. | |
| --FILE-- | |
| function return_empty_string($string) { | |
| return ""; | |
| } | |
| function return_false($string) { | |
| return false; | |
| } | |
| function return_null($string) { | |
| return null; | |
| } | |
| function return_string($string) { | |
| return "I stole your output."; | |
| } | |
| function return_zero($string) { | |
| return 0; | |
| } | |
| // Use each of the above functions as an output buffering callback: | |
| $functions = get_defined_functions(); | |
| $callbacks = $functions['user']; | |
| sort($callbacks); | |
| foreach ($callbacks as $callback) { | |
| echo "--> Use callback '$callback':\n"; | |
| ob_start($callback); | |
| echo 'My output.'; | |
| ob_end_flush(); | |
| echo "\n\n"; | |
| } | |
| --EXPECT-- | |
| --> Use callback 'return_empty_string': | |
| --> Use callback 'return_false': | |
| My output. | |
| --> Use callback 'return_null': | |
| --> Use callback 'return_string': | |
| I stole your output. | |
| --> Use callback 'return_zero': | |
| 0 | |